contrib/subtree: portability fix for string printing
commit2ded109b51878fb0bc131945676c90f1d1051213
authorDanny Lin <danny0838@gmail.com>
Fri, 8 May 2015 00:56:59 +0000 (8 08:56 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 May 2015 19:09:38 +0000 (8 12:09 -0700)
treed4edcd771a31b45c20f1c1956a2f74b5a7e46519
parent16018ae5fb368151f3eff13730cf089b63f41962
contrib/subtree: portability fix for string printing

'echo -n' is not portable, but this script used it as a way to give
a string followed by a carriage return for progress messages.
Introduce a new helper shell function "progress" and use printf as a
more portable way to do this.  As a side effect, this makes it
unnecessary to have a raw CR in our source, which can be munged in
some shells.  For example, MsysGit trims CR before executing a shell
script file in order to make it work right on Windows even if it
uses CRLF as linefeeds.

While at it, replace "echo" using printf in debug() and say() to
eliminate the temptation of reintroducing the same bug.

Signed-off-by: Danny Lin <danny0838@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh