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

Re: [RFC PATCHv3 1/4] am: avoid re-directing stdin twice

From
Torsten Bögershausen <tboegi@web.de>
Date
Sep 6, 2014, 12:46 UTC
Message-ID
<540B0228.1070201@web.de>
In-Reply-To
<xmqqbnqtp5he.fsf@gitster.dls.corp.google.com>
On 2014-09-06 09.34, Junio C Hamano wrote:
Show 15 quoted lines
> Stephen Boyd <bebarino@gmail.com> writes:
> 
>>>> I see Stephen who wrote the original "Thunderbird save-as" is
>>>> already on the Cc list.  How about doing it this way instead?
>>
>> It was so long ago I can't even remember writing that patch. But I
>> googled the thread from 4.5 years ago and I see that you suggested we
>> use tr because \r is not portable[1].
> 
> Hmph.  That's unfortunate that this may be one of those things that
> even though it is in POSIX the real world prevents us from using it.
> 
> I wonder if things changed over the past four years, though.  Can
> folks on OSX or BSD do a quick check?
>

I may have missed the discussion, does this help? "\r" can be used with tr, but not with sed:

tb@macosx:/tmp> cat ./xx.sh #!/bin/sh which tr printf "AB\rCD\n" | tr 'A\r\n\BCD' 'aRNbcd' | xxd printf "E\rE" | tr -d '\r' | xxd which sed printf "AB\rCD\n" | sed -e 's/\r/R/g' | xxd printf "E\rE" | sed -e 's/\r//g' | xxd

tb@macosx:/tmp> ./xx.sh /usr/bin/tr 0000000: 6162 5263 644e abRcdN 0000000: 4545 EE /usr/bin/sed 0000000: 4142 0d43 440a AB.CD. 0000000: 450d 450a E.E. tb@macosx:/tmp>

Previous: Junio C HamanoNext: Chris Packham
Message 10 of 13 in “[RFC PATCHv3 0/4] am: patch-format”
  1. Chris PackhamSep 5, 2014
  2. 1/4 am: avoid re-directing stdin twiceChris Packham, Sep 5, 2014
  3. Johannes SixtSep 5, 2014
  4. Chris PackhamSep 5, 2014
  5. Junio C HamanoSep 5, 2014
  6. Junio C HamanoSep 5, 2014
  7. Junio C HamanoSep 5, 2014
  8. Stephen BoydSep 5, 2014
  9. Junio C HamanoSep 6, 2014
  10. Torsten BögershausenSep 6, 2014
  11. 2/4 t/am: add test for stgit patch formatChris Packham, Sep 5, 2014
  12. 3/4 t/am: add tests for hg patch formatChris Packham, Sep 5, 2014
  13. 4/4 am: add gitk patch formatChris Packham, Sep 5, 2014

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.