Re: [PATCH v2] rebase -i: respect core.commentchar
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2013, 17:29 UTC
- Message-ID
- <7v4nhhigp5.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130212095340.GG2270@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 19 quoted lines
> ... the following fixup is also needed to avoid relying on the shell > emitting a literal backslash when a backslash isn't followed by a known > escape character. > > -- >8 -- > > diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh > index cbe36bf..84bd525 100755 > --- a/t/t3404-rebase-interactive.sh > +++ b/t/t3404-rebase-interactive.sh > @@ -947,7 +947,7 @@ test_expect_success 'rebase -i respects core.commentchar' ' > test_when_finished "git config --unset core.commentchar" && > cat >comment-lines.sh <<EOF && > #!$SHELL_PATH > -sed -e "2,\$ s/^/\\\\\\/" "\$1" >"\$1".tmp > +sed -e "2,\$ s/^/\\\\\\\\/" "\$1" >"\$1".tmp > mv "\$1".tmp "\$1" > EOF > chmod a+x comment-lines.sh &&
Yeek. If you used write_script with here-text that does not interpolate,
write_script remove-all-but-the-first.sh <<\EOF
sed -e '2,$s/^/\\/' <"$1" >"$1.tmp" &&
mv "$1.tmp" "$1"
EOFthe above would be much more readable.
I am not sure if I understand what you meant by "literal backslash blah blah", though.