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

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

2014-03-17 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 --- Changed $@ to $* in printf. Thanks to Johannes Sixt to point that out. t/test-lib.sh | 4

Re: [PATCH v2] rebase -i: replace an echo command by printf

2014-03-17 Thread Uwe Storbeck
On Mar 17, Junio C Hamano wrote: Will tentatively queue with the above rewrite, but if you feel strongly, please send an replacement. No need for a replacement, your wording is good. I couldn't do it better. I'll borrow your commit message for my other patch to fix the continued title there

[PATCH v3] test-lib.sh: do not echo externally supplied strings

2014-03-17 Thread Uwe Storbeck
In some places we echo a string that is supplied by the calling test script and may contain backslash sequences. The echo command of some shells, most notably dash, interprets these backslash sequences (POSIX.1 allows this) which may scramble the test output. Signed-off-by: Uwe Storbeck u

Re: Corner case bug caused by shell dependent behavior

2014-03-14 Thread Uwe Storbeck
On Mar 13, Jonathan Nieder wrote: May we have your sign-off? (See Documentation/SubmittingPatches section Sign your work for what this means. I could have found that myself .. thanks! I'll try to follow it now. :) I'll resend the patch. Hopefully I'll do it right. Would it make sense to add

[PATCH v2] rebase -i: replace an echo command by printf

2014-03-14 Thread Uwe Storbeck
to be removed or the rebase fails. Signed-off-by: Uwe Storbeck u...@ibr.ch --- git-rebase--interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 43c19e0..43631b4 100644 --- a/git-rebase--interactive.sh +++ b/git

[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 a/t/test

[PATCH/RFC] t3404: test autosquash for fixup! commits with funny messages

2014-03-14 Thread Uwe Storbeck
command interprets backslash sequences as control characters. Signed-off-by: Uwe Storbeck u...@ibr.ch --- t/t3404-rebase-interactive.sh | 12 1 file changed, 12 insertions(+) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 50e22b1..6d32661 100755 --- a/t

Corner case bug caused by shell dependent behavior

2014-03-13 Thread Uwe Storbeck
. The attached one-line patch fixes the bug. Be free to edit the commit message when it's too long. Maybe there are more places where it would be more robust to use printf instead of echo. Uwe From 53262bc8a7a3ec9d9a6b0e8ecaaea598257b87fe Mon Sep 17 00:00:00 2001 From: Uwe Storbeck u...@ibr.ch Date: Fri

Asymmetric default behavior of git stash

2013-08-27 Thread Uwe Storbeck
Hi, is there any reason why the default behavior of git stash is asymmetric? When I save my current state with 'git stash save' it saves the worktree changes and the index changes (and resets both). When I restore the state with 'git stash pop' it restores the worktree changes, but not the state