Merge branch 'nd/untracked-cache'
[gitweb.git] / contrib / subtree / git-subtree.sh
index 6328c87bc85441dad30e7acda22f28682e76d2c6..07bd77c4c8c63cff3ecac05f9ce922fda5fddf67 100755 (executable)
@@ -51,14 +51,21 @@ prefix=
 debug()
 {
        if [ -n "$debug" ]; then
-               echo "$@" >&2
+               printf "%s\n" "$*" >&2
        fi
 }
 
 say()
 {
        if [ -z "$quiet" ]; then
-               echo "$@" >&2
+               printf "%s\n" "$*" >&2
+       fi
+}
+
+progress()
+{
+       if [ -z "$quiet" ]; then
+               printf "%s\r" "$*" >&2
        fi
 }
 
@@ -599,7 +606,7 @@ cmd_split()
        eval "$grl" |
        while read rev parents; do
                revcount=$(($revcount + 1))
-               say -n "$revcount/$revmax ($createcount)\r"
+               progress "$revcount/$revmax ($createcount)"
                debug "Processing commit: $rev"
                exists=$(cache_get $rev)
                if [ -n "$exists" ]; then