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

Re: [RFC PATCH v2] shortlog: add group-by options for year and month

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 7, 2022, 22:24 UTC
Message-ID
<Y0CnJBzTbNgRIqZ+@nand.local>
In-Reply-To
<Yz4EsT8noIoygk9b@coredump.intra.peff.net>
On Wed, Oct 05, 2022 at 06:26:57PM -0400, Jeff King wrote:
Show 27 quoted lines
> > +static void insert_record_from_pretty(struct shortlog *log,
> > +				      struct strset *dups,
> > +				      struct commit *commit,
> > +				      struct pretty_print_context *ctx,
> > +				      const char *oneline)
> > +{
> > +	struct strbuf ident = STRBUF_INIT;
> > +	size_t i;
> > +
> > +	for (i = 0; i < log->pretty.nr; i++) {
> > +		if (i)
> > +			strbuf_addch(&ident, ' ');
> > +
> > +		format_commit_message(commit, log->pretty.items[i].string,
> > +				      &ident, ctx);
> > +	}
>
> So here you're allowing multiple pretty options. But really, once we
> allow the user an arbitrary format, is there any reason for them to do:
>
>   git shortlog --group=%an --group=%ad
>
> versus just:
>
>   git shortlog --group='%an %ad'
>
> ?

I think that if you want to unify `--group=author` into the new format group implementation, you would have to allow multiple `--group` options, but each such option would generate its own shortlog identity instead of getting concatenated together.

Thanks, Taylor

Previous: Jeff KingNext: Jeff King
Message 15 of 16 in “shortlog: add group-by options for year and month”
  1. shortlog: add group-by options for year and monthJacob Stopak, Sep 22, 2022
  2. Martin ÅgrenSep 22, 2022
  3. shortlog: add group-by options for year and monthJacob Stopak, Sep 22, 2022
  4. Junio C HamanoSep 23, 2022
  5. Jacob StopakSep 23, 2022
  6. Jeff KingSep 23, 2022
  7. Junio C HamanoSep 23, 2022
  8. Jacob StopakSep 24, 2022
  9. Jeff KingOct 5, 2022
  10. Taylor BlauOct 5, 2022
  11. Jeff KingOct 5, 2022
  12. Jacob StopakOct 7, 2022
  13. Taylor BlauOct 7, 2022
  14. Jeff KingOct 11, 2022
  15. Taylor BlauOct 7, 2022
  16. Jeff KingOct 11, 2022

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.