Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-20 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: ... I am a bit reluctant to name the helper sane_echo to declare echo that interprets backslashes in the string is insane, though. For these print a single line uses, we are only interested in using a subset of the features

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-19 Thread David Kastrup
Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: Uwe Storbeck wrote: + printf '%s\n' $@ | sed -e 's/^/# /' This is wrong, isn't it? Why do we want one line per item here? Yes, Hannes caught the same, too. Sorry for the

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-19 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: Uwe Storbeck wrote: + printf '%s\n' $@ | sed -e 's/^/# /' This is wrong, isn't it? Why do we want one line per item here? Yes, Hannes caught the same, too. Sorry for the sloppiness. We currently use echo all over

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-19 Thread Junio C Hamano
David Kastrup d...@gnu.org writes: Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: Uwe Storbeck wrote: +printf '%s\n' $@ | sed -e 's/^/# /' This is wrong, isn't it? Why do we want one line per item here? Yes,

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-19 Thread Jonathan Nieder
Junio C Hamano wrote: Jonathan Nieder jrnie...@gmail.com writes: We currently use echo all over the place (e.g., 'echo $path' in git-sh-setup), and every time we fix it there is a chance of making mistakes. I wonder if it would make sense to add a helper to make the echo calls easier to

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-18 Thread Jonathan Nieder
Junio C Hamano wrote: Uwe Storbeck wrote: + printf '%s\n' $@ | sed -e 's/^/# /' This is wrong, isn't it? Why do we want one line per item here? Yes, Hannes caught the same, too. Sorry for the sloppiness. We currently use echo all over the place (e.g., 'echo $path' in git-sh-setup),

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-17 Thread Uwe Storbeck
On Mar 15, Johannes Sixt wrote: - echo $@ | sed -e 's/^/# /' + printf '%s\n' $@ | sed -e 's/^/# /' This should be printf '%s\n' $* | sed -e 's/^/# /' Right, that should be $* to always be one argument for the format pattern. Thanks Uwe -- To unsubscribe from

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-17 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Uwe Storbeck wrote: Backslash sequences are interpreted as control characters by the echo command of some shells (e.g. dash). This has bothered me for a while but never enough to do anything about it. Thanks for fixing it. Signed-off-by: Uwe

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-15 Thread Johannes Sixt
Am 15.03.2014 00:57, schrieb Uwe Storbeck: when variables may contain backslash sequences. Backslash sequences are interpreted as control characters by the echo command of some shells (e.g. dash). Signed-off-by: Uwe Storbeck u...@ibr.ch --- t/test-lib.sh | 4 ++-- 1 file changed, 2

[PATCH] test-lib.sh: use printf instead of echo

2014-03-14 Thread Uwe Storbeck
when variables may contain backslash sequences. Backslash sequences are interpreted as control characters by the echo command of some shells (e.g. dash). Signed-off-by: Uwe Storbeck u...@ibr.ch --- t/test-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] test-lib.sh: use printf instead of echo

2014-03-14 Thread Jonathan Nieder
Uwe Storbeck wrote: Backslash sequences are interpreted as control characters by the echo command of some shells (e.g. dash). This has bothered me for a while but never enough to do anything about it. Thanks for fixing it. Signed-off-by: Uwe Storbeck u...@ibr.ch Reviewed-by: Jonathan