From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>, Stephen Boyd <bebarino@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>, GIT <git@vger.kernel.org>,
Chris Packham <judge.packham@gmail.com>
Subject: Re: [RFC PATCHv3 1/4] am: avoid re-directing stdin twice
Date: Sat, 06 Sep 2014 14:46:32 +0200 [thread overview]
Message-ID: <540B0228.1070201@web.de> (raw)
In-Reply-To: <xmqqbnqtp5he.fsf@gitster.dls.corp.google.com>
On 2014-09-06 09.34, Junio C Hamano wrote:
> 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>
next prev parent reply other threads:[~2014-09-06 12:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 10:06 [RFC PATCHv3 0/4] am: patch-format Chris Packham
2014-09-05 10:06 ` [RFC PATCHv3 1/4] am: avoid re-directing stdin twice Chris Packham
2014-09-05 20:26 ` Johannes Sixt
2014-09-05 21:31 ` Chris Packham
2014-09-05 22:00 ` Junio C Hamano
2014-09-05 22:16 ` Junio C Hamano
2014-09-05 22:25 ` Junio C Hamano
2014-09-05 23:18 ` Stephen Boyd
2014-09-06 7:34 ` Junio C Hamano
2014-09-06 12:46 ` Torsten Bögershausen [this message]
2014-09-05 10:06 ` [RFC PATCHv3 2/4] t/am: add test for stgit patch format Chris Packham
2014-09-05 10:06 ` [RFC PATCHv3 3/4] t/am: add tests for hg " Chris Packham
2014-09-05 10:06 ` [RFC PATCHv3 4/4] am: add gitk " Chris Packham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540B0228.1070201@web.de \
--to=tboegi@web.de \
--cc=bebarino@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=judge.packham@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).