Re: Bug: git-rebase goofs up \n in commit messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 25, 2007 at 11:11:26PM +0200, Szekeres Istvan wrote:

> while playing with git I found the following bug: if a commit message
> contains "\n" (as a string, not as a character), git-rebase changes this
> string into a literal newline character.

Hmm. The culprit seems to be git-am.sh, line 313:

  SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"

and even more exciting, it seems to be a bash vs dash thing. Try this:

$ cat >content-with-escapes <<'EOF'
foo \n bar
EOF

$ bash
bash$ test=$(cat content-with-escapes)
bash$ echo $test
foo \n bar

$ dash
dash$ test=$(cat content-with-escapes)
dash$ echo $test
foo
 bar


Hmm. It even happens with this:

bash$ export test=$(echo foo \\n bar)
bash$ dash
dash$ echo $test
foo
 bar

I'm not sure what the best workaround is.  I am cc'ing Herbert Xu to see
if he has any helpful comments.

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux