John Keeping <j...@keeping.me.uk> writes:

> ... 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"
        EOF

the above would be much more readable.

I am not sure if I understand what you meant by "literal backslash
blah blah", though.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to