git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 8, 2008, 19:26 UTC
Message-ID
<7vej3ufnh3.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080908192313.GB4148@regex.yaph.org>
arjen@yaph.org (Arjen Laarhoven) writes:
Show 18 quoted lines
> On Mon, Sep 08, 2008 at 02:06:02PM -0500, Brandon Casey wrote:
> [...]
>> 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.

Previous: Arjen Laarhoven
Message 4 of 4 in “t6023-merge-file: Work around non-portable sed usage”
  1. t6023-merge-file: Work around non-portable sed usageArjen Laarhoven, Sep 8, 2008
  2. Brandon CaseySep 8, 2008
  3. Arjen LaarhovenSep 8, 2008
  4. Junio C HamanoSep 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.