From: Junio C Hamano <gitster@pobox.com>
To: David Aguilar <davvid@gmail.com>
Cc: Seth House <seth@eseth.com>,
Git Mailing List <git@vger.kernel.org>,
Felipe Contreras <felipe.contreras@gmail.com>
Subject: Re: What's cooking in git.git (Jan 2021, #02; Fri, 8)
Date: Sat, 09 Jan 2021 15:08:41 -0800 [thread overview]
Message-ID: <xmqqft39emiu.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAJDDKr6V+kKMs4yz+YQx1AhiY5qQwENfs_yZqxXWBqmLUk2oAw@mail.gmail.com> (David Aguilar's message of "Sat, 9 Jan 2021 13:38:20 -0800")
David Aguilar <davvid@gmail.com> writes:
> Fun times in sed portability land. After a bit of experimentation,
> this is what I've managed to whip up:
>
> cr=$(printf '\x0d')
> sed -e "/^<<<<<<< /,/^=======$cr\{0,1\}$/d" -e '/^>>>>>>> /d' tiger
>
> - Instead of \r use printf to capture CR into a string so that we can
> embed the literal using $cr.
> - DQ "..." instead of SQ '...' to allow $cr to be substituted in the string.
> - Instead of \? use \{0,1\} which seems to work on both macOS and Linux.
Ah, all the fun with avoiding GNU-ism in scripts; thanks for
figuring it out.
I am perfectly fine with the above, but I also am OK with Perl
script. We may even be able to generate three output files in a
single pass by passing their filenames and open them for writing in
the script.
> That seems to work and the tests now pass.
> If not sed, is there perhaps a perl equivalent for these multi-line
> delete-from-X-until-Y expressions that might provide better
> portability?
> I'll start putting together a patch shortly as this seems to work in
> practice. Let me know if y'all have any sugs or if there are any
> portability pitfalls I'm not considering.
next prev parent reply other threads:[~2021-01-09 23:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 19:22 What's cooking in git.git (Jan 2021, #02; Fri, 8) Junio C Hamano
2021-01-09 10:55 ` Ævar Arnfjörð Bjarmason
2021-01-09 21:28 ` Junio C Hamano
2021-01-09 22:05 ` brian m. carlson
2021-01-09 23:20 ` Junio C Hamano
2021-01-11 1:53 ` brian m. carlson
2021-01-11 19:04 ` Junio C Hamano
2021-01-12 14:00 ` Ævar Arnfjörð Bjarmason
2021-01-14 23:52 ` Emily Shaffer
2021-01-14 23:56 ` Emily Shaffer
2021-01-15 7:22 ` Junio C Hamano
2021-01-15 0:29 ` brian m. carlson
2021-01-15 1:44 ` Junio C Hamano
2021-01-16 16:23 ` Ævar Arnfjörð Bjarmason
2021-01-17 17:15 ` Jeff King
2021-01-17 20:22 ` Ævar Arnfjörð Bjarmason
2021-01-10 19:00 ` Ævar Arnfjörð Bjarmason
2021-01-11 0:21 ` Junio C Hamano
2021-01-09 21:38 ` David Aguilar
2021-01-09 23:08 ` Junio C Hamano [this message]
2021-01-14 23:06 ` Emily Shaffer
2021-01-15 1:50 ` Junio C Hamano
2021-01-15 2:24 ` Taylor Blau
2021-01-15 2:44 ` Taylor Blau
2021-01-15 2:36 ` Derrick Stolee
2021-01-15 2:54 ` Derrick Stolee
2021-01-15 6:36 ` Junio C Hamano
2021-01-15 6:38 ` Junio C Hamano
2021-01-15 11:36 ` Derrick Stolee
2021-01-15 19:44 ` Junio C Hamano
2021-01-15 20:08 ` Emily Shaffer
2021-01-15 20:59 ` Junio C Hamano
2021-01-15 19:52 ` Jeff King
2021-01-15 21:40 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqft39emiu.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=davvid@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=seth@eseth.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).