Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] t6023-merge-file: Work around non-portable sed usage

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:20

arjen@yaph.org (Arjen Laarhoven) writes:
On Mon, Sep 08, 2008 at 02:06:02PM -0500, Brandon Casey wrote:
[...]
quoted
I was just encountering this myself.

sed can be fixed without the use of tr by replacing '\n' with an explicit newline like:

sed -e 's/deerit./&\
\
\
\
/' -e "s/locavit,/locavit;/" < new6.txt > new8.txt

Of course it doesn't fit on one line though.
I don't think replacing 2 lines with 10 is a big win (not counting a
possible comment explaining why it's necessary).  I'd rather replaced
the thing with a Perl one-liner though, but that seems a bit frowned
upon, correct?
Perl one-liner is Ok, so are pregenerated test vectors in separate
directory (i.e. ship with t/t6023/new6.txt file and refer to it from the
test as "$TEST_DIRECTORY/t6023/new6.txt"), but I think your original patch
to use % is perfectly fine for this one.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help