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
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 11, 2025, 19:05 UTC
Message-ID
<CAPig+cTezW8XYjNo3L3Qy+f+aiCXppTj-Z=N0bBMG8mp9jJ8ZA@mail.gmail.com>
In-Reply-To
<xmqqy0tyi8aj.fsf@gitster.g>
On Wed, Jun 11, 2025 at 11:55 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> From: Siddharth Asthana <siddharthasthana31@gmail.com>
> > +     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"
>
> 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`?).

The only case I can think of in which there was a semicolon-related problem (and perhaps what you're thinking of) was when a recent patch[*] neglected to insert a semicolon where it was expected. That particular case involved a missing semicolon before a closing brace:

    sed -n '/ version /{p;q}'
which should have been:
    sed -n '/ version /{p;q;}'

To summarize: Using semicolon-separated commands is safe and portable; I don't think there is any evidence that doing so would be problematic. Whether to use semicolon-separated commands or multiple `-e` arguments is subjective, and I don't believe the project has expressed a preference for one for or the other.

[*]: https://lore.kernel.org/git/CAPig+cR+ESNg4tV1G6jbKKeRKABD053qZcG0BoFuQ7aC+1tGYw@mail.gmail.com/
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 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.