echo "\e[1m$*\e[m"
}
-checksum()
-{
- if [ -x /usr/bin/md5sum ]; then
- /usr/bin/md5sum "$@"
- elif [ -x /bin/md5sum ]; then
- /bin/md5sum "$@"
- elif [ -x /usr/bin/cksum ]; then
- /usr/bin/cksum "$@"
- else
- echo "NOCHECKSUM"
- fi
-}
-
-self=`checksum "$SELF"`
+self=`git hash-object "$SELF"`
checkself()
{
- self_new=`checksum "$SELF"`
+ self_new=`git hash-object "$SELF"`
if [ x"$self" != x"$self_new" ]; then
msg "./all has changed."
if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
enter "$d0/$d" verbose
r=`git symbolic-ref HEAD`
r=${r#refs/heads/}
- if git diff HEAD | grep .; then
+ diffdata=`git diff --color HEAD`
+ if [ -n "$diffdata" ]; then
# we have uncommitted changes
- if yesno "Uncommitted changes in \"$r\" in $dv. Commit?"; then
+ if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" 'echo "$diffdata" | less -r'; then
verbose git commit -a
fi
fi
rem=`git config "branch.$r.remote" || echo origin`
bra=`git config "branch.$r.merge" || echo "$r"`
upstream="$rem/$bra"
- if ! [ git rev-parse "$upstream" ]; then
+ if ! git rev-parse "$upstream" >/dev/null 2>&1; then
upstream="`repobranch "$d"`"
fi
- if git log "$upstream".."$r" | grep .; then
- if yesno "Push \"$r\" in $dv?"; then
+ logdata=`git log --color "$upstream".."$r"`
+ if [ -n "$logdata" ]; then
+ if yesno "Push \"$r\" in $dv?" 'echo "$logdata" | less -r'; then
verbose git push "$rem" HEAD
fi
fi