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

Re: [PATCH] cat-file: fix mailmap application for different author and committer

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 11, 2025, 23:35 UTC
Message-ID
<xmqq7c1hhmx7.fsf@gitster.g>
In-Reply-To
<CAPig+cTezW8XYjNo3L3Qy+f+aiCXppTj-Z=N0bBMG8mp9jJ8ZA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 7 quoted lines
>> 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 ...
Show 5 quoted lines
>> > +     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.

Previous: Eric SunshineNext: Siddharth Asthana
Message 6 of 10 in “cat-file: fix mailmap application for different author and committer”
  1. cat-file: fix mailmap application for different author and committersiddharthasthana31@gmail.com, Jun 11, 2025
  2. Christian CouderJun 11, 2025
  3. Junio C HamanoJun 12, 2025
  4. Junio C HamanoJun 11, 2025
  5. Eric SunshineJun 11, 2025
  6. Junio C HamanoJun 11, 2025
  7. Siddharth AsthanaJun 13, 2025
  8. cat-file: fix mailmap application for different author and committersiddharthasthana31@gmail.com, Jun 13, 2025
  9. Christian CouderJun 13, 2025
  10. Junio C HamanoJun 13, 2025

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.