From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: siddharthasthana31@gmail.com, git@vger.kernel.org,
christian.couder@gmail.com, viakliushin@gitlab.com,
johncai86@gmail.com
Subject: Re: [PATCH] cat-file: fix mailmap application for different author and committer
Date: Wed, 11 Jun 2025 16:35:16 -0700 [thread overview]
Message-ID: <xmqq7c1hhmx7.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cTezW8XYjNo3L3Qy+f+aiCXppTj-Z=N0bBMG8mp9jJ8ZA@mail.gmail.com> (Eric Sunshine's message of "Wed, 11 Jun 2025 15:05:14 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
>> may be easier to read and more portable (as some implementation of
>> sed is picky about semicolon concatenated multiple commands).
>
> For what it's worth, Git test scripts already contain a fair number of
> uses of semicolon-separated `sed` commands, and we haven't heard of
> any problems with them; not even from the very old and quite picky
> Solaris `sed` (or was it the ancient SunOS `sed`?).
I think it was of BSD lineage, but I phrased it poorly.
> sed -n '/ version /{p;q}'
This pattern did cause issues in the past. I was hoping that we can
avoid it by training our developers to avoid concatenation with
semicolons in general, but {grouped} commands cannot be fed without
properly using semicolons anyway, so it would not help to just
generally avoid use of semicolons.
On the other hand, the suggestion that was given in the message ...
>> > + sed -n "/^author /s/\([^>]*>\).*/\1/p; /^committer /s/\([^>]*>\).*/\1/p" log >actual &&
>>
>> Perhaps just a matter of taste, but
>>
>> sed -n -e "/^author /s/>.*/>/p" -e "/^committer /s/>.*/>/p"
... is much shorter, simpler and easier to understand. With the
added benefit that you can even line-wrap sensibly
sed -n -e "/^author /s/>.*/>/p" \
-e "/^committer /s/>.*/>/p"
there really isn't a good reason not to adopt the style, compared to
the way the patch was originally written.
next prev parent reply other threads:[~2025-06-11 23:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 6:26 [PATCH] cat-file: fix mailmap application for different author and committer siddharthasthana31
2025-06-11 9:38 ` Christian Couder
2025-06-12 23:49 ` Junio C Hamano
2025-06-11 15:53 ` Junio C Hamano
2025-06-11 19:05 ` Eric Sunshine
2025-06-11 23:35 ` Junio C Hamano [this message]
2025-06-13 9:20 ` Siddharth Asthana
2025-06-13 11:57 ` [PATCH v2] " siddharthasthana31
2025-06-13 12:59 ` Christian Couder
2025-06-13 15:56 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7c1hhmx7.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=johncai86@gmail.com \
--cc=siddharthasthana31@gmail.com \
--cc=sunshine@sunshineco.com \
--cc=viakliushin@gitlab.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