summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-22 19:41:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-22 19:41:45 (GMT)
commitb54301bdadfd3195d64e95ef6f58dfdf102e3d26 (patch)
treed1b57b45c3789da04a1707220a6ec0cba8f6b4ed
parent8087a620863dde1c589f072abd4e6b9ef1017a62 (diff)
parent2ded109b51878fb0bc131945676c90f1d1051213 (diff)
downloadgit-b54301bdadfd3195d64e95ef6f58dfdf102e3d26.zip
git-b54301bdadfd3195d64e95ef6f58dfdf102e3d26.tar.gz
git-b54301bdadfd3195d64e95ef6f58dfdf102e3d26.tar.bz2
Merge branch 'dl/subtree-avoid-tricky-echo'
"git subtree" script (in contrib/) used "echo -n" to produce progress messages in a non-portable way. * dl/subtree-avoid-tricky-echo: contrib/subtree: portability fix for string printing
-rwxr-xr-xcontrib/subtree/git-subtree.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 6328c87..07bd77c 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -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) "
+ progress "$revcount/$revmax ($createcount)"
debug "Processing commit: $rev"
exists=$(cache_get $rev)
if [ -n "$exists" ]; then