Re: [BUGS] test failure in t4014-format-patch.sh with master

Subsystems: the rest

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [BUGS] test failure in t4014-format-patch.sh with master

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:29

"Rémi Vanicat" [off-list ref] writes:
2008/4/17, Linus Torvalds [off-list ref]:
quoted
 On Thu, 17 Apr 2008, Remi Vanicat wrote:
[...]
quoted
 > $ ./t4014-format-patch.sh
 > [....]
 > * FAIL 8: replay did not screw up the log message

 Hmm. Doesn't fail for me.
[...]
quoted
 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
quoted
 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

Re: [BUGS] test failure in t4014-format-patch.sh with master

From: Rémi Vanicat <hidden>
Date: 2016-06-15 22:44:29

2008/4/18, Linus Torvalds [off-list ref]:

 On Fri, 18 Apr 2008, Junio C Hamano wrote:
 >
 > -             (echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
 > +             (printf '%s\n' "$SUBJECT" ; echo ; cat "$dotest/msg") |


Well, get rid of the superfluous second 'echo' then too, replacing it
 with another '\n'. IOW:

        ( printf '%s\n\n' "$SUBJECT" ; cat "$dotest/msg" ) |

 instead.
This work for me: no more test failure on my computer

Re: [BUGS] test failure in t4014-format-patch.sh with master

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:44:29


On Fri, 18 Apr 2008, Junio C Hamano wrote:
-		(echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
+		(printf '%s\n' "$SUBJECT" ; echo ; cat "$dotest/msg") |
Well, get rid of the superfluous second 'echo' then too, replacing it 
with another '\n'. IOW:

	( printf '%s\n\n' "$SUBJECT" ; cat "$dotest/msg" ) | 

instead.

		Linus

Re: [BUGS] test failure in t4014-format-patch.sh with master

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:29

"Rémi Vanicat" [off-list ref] writes:
2008/4/18, Linus Torvalds [off-list ref]:
quoted

 On Fri, 18 Apr 2008, Junio C Hamano wrote:
 >
 > -             (echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
 > +             (printf '%s\n' "$SUBJECT" ; echo ; cat "$dotest/msg") |


Well, get rid of the superfluous second 'echo' then too, replacing it
 with another '\n'. IOW:

        ( printf '%s\n\n' "$SUBJECT" ; cat "$dotest/msg" ) |

 instead.
This work for me: no more test failure on my computer
Thanks for confirmation.  I reproduced the breakage and the fix myself
with "make SHELL_PATH=/bin/dash" myself, too.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help