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

Re: [PATCH 2/2] shortlog: introduce `--email-only` to only show emails

From
Johannes Sixt <j6t@kdbg.org>
Date
Jun 8, 2023, 07:35 UTC
Message-ID
<67c66cd7-fb6c-3fa0-82c8-0e778f377f96@kdbg.org>
In-Reply-To
<44179d28fa7676965a28734e20584d54b44e051b.1686178917.git.me@ttaylorr.com>
Am 08.06.23 um 01:02 schrieb Taylor Blau:
Show 37 quoted lines
> When a shortlog caller wants to group output by, say, author email, they
> can easily express this with:
> 
>     $ git shortlog --group=format:%ae
> 
> and restrict output to specific email(s) with the new `--group-filter`
> option introduced by the previous commit.
> 
> But they are not able to apply the same treatment to identities that
> appear in trailers. Doing:
> 
>     $ git shortlog -e --group=format:%ae --group=trailer:Co-authored-by
> 
> will produce funky results, interspersing proper emails with full "Name
> <email>" identities from the Co-authored-by trailer (or anything else
> that might appear there), like:
> 
>     461  me@ttaylorr.com
>      11  Taylor Blau <me@ttaylorr.com>
> 
> So if the caller wants to restrict output to a set of matching email
> addresses (say, "me@ttaylorr.com"), they cannot do it with a
> `--group-filter`, since it would discard the group "Taylor Blau
> <me@ttaylorr.com>".
> 
> Introduce a new `--email-only` option, which extracts the email
> component of an identity from all shortlog groups, including trailers.
> It behaves similarly to the `-e` option, but replaces its output with
> just the email component, instead of adding it on to the end.
> 
> Now, `shortlog` callers can perform:
> 
>     $ git shortlog -s --group=author --group=trailer:Co-authored-by \
>         --email-only --group-filter="<me@ttaylorr.com>"
>        472  <me@ttaylorr.com>
> 
> to obtain the output they want.

A note from the peanut gallery: "--email-only" sounds like an option that affects the output of the command. But it does not (IIUC), there is no hint that it affects grouping and filtering. It is named too generically, IMHO. Can we not have the desired effect by specifying some token to one of the --group* options?

-- Hannes
Previous: Taylor BlauNext: Taylor Blau
Message 6 of 8 in “shortlog: introduce --email-only, --group-filter options”
  1. 0/2 shortlog: introduce --email-only, --group-filter optionsTaylor Blau, Jun 7, 2023
  2. 1/2 shortlog: introduce `--group-filter` to restrict outputTaylor Blau, Jun 7, 2023
  3. Derrick StoleeJun 8, 2023
  4. Taylor BlauJun 8, 2023
  5. 2/2 shortlog: introduce `--email-only` to only show emailsTaylor Blau, Jun 7, 2023
  6. Johannes SixtJun 8, 2023
  7. Taylor BlauJun 8, 2023
  8. Junio C HamanoJun 12, 2023

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.