From: Junio C Hamano Date: Fri, 22 May 2015 19:41:45 +0000 (-0700) Subject: Merge branch 'dl/subtree-avoid-tricky-echo' X-Git-Tag: v2.5.0-rc0~98 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b54301bdadfd3195d64e95ef6f58dfdf102e3d26?hp=-c 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 --- b54301bdadfd3195d64e95ef6f58dfdf102e3d26 diff --combined contrib/subtree/git-subtree.sh index 6328c87bc8,d4dae7ab5b..07bd77c4c8 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@@ -26,7 -26,7 +26,7 @@@ b,branch= create a new branch from ignore-joins ignore prior --rejoin commits onto= try connecting new tree to an existing one rejoin merge the new branch back into HEAD - options for 'add', 'merge', 'pull' and 'push' + options for 'add', 'merge', and 'pull' squash merge subtree changes as a single commit " eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)" @@@ -51,14 -51,21 +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 +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