From: Junio C Hamano Date: Fri, 18 Apr 2008 18:30:48 GMT Subject: Re: [BUGS] test failure in t4014-format-patch.sh with master Message-ID: <7vskxjj9rb.fsf@gitster.siamese.dyndns.org> In-Reply-To: <6b8a91420804170844t2776e8a7sf735e3f87a95298b@mail.gmail.com> "Rémi Vanicat" writes: > 2008/4/17, Linus Torvalds : >> >> On Thu, 17 Apr 2008, Remi Vanicat wrote: > [...] >> > $ ./t4014-format-patch.sh >> > [....] >> > * FAIL 8: replay did not screw up the log message >> >> Hmm. Doesn't fail for me. > > [...] > >> I wonder if it is some shell-specific variable expansion issue. What's >> your /bin/sh? (I assume, from your email address, that you're using >> Debian, and I thought Debian used bash, but maybe that's not true). > > Debian used bash, but I use dash as /bin/sh > >> What does >> >> a="hello\nhi" >> echo $a >> >> result in? So perhaps this one is the troublemaker? git-am.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/git-am.sh b/git-am.sh index 646dc45..5b20bbd 100755 --- a/git-am.sh +++ b/git-am.sh @@ -330,7 +330,7 @@ do SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")" case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac - (echo "$SUBJECT" ; echo ; cat "$dotest/msg") | + (printf '%s\n' "$SUBJECT" ; echo ; cat "$dotest/msg") | git stripspace > "$dotest/msg-clean" ;; esac