mbox series

[0/8] parsing trailers with shortlog

Message ID 20200925070120.GA3669667@coredump.intra.peff.net (mailing list archive)
Headers show
Series parsing trailers with shortlog | expand

Message

Jeff King Sept. 25, 2020, 7:01 a.m. UTC
Somebody mentioned at the inclusion summit that it would be nice for
mentoring/pairing relationships if we could more easily give credit to
multiple authors of a commit. When people ask about adding multiple
"author" headers, we usually recommend that they use a "co-authored-by"
trailer. But you can't convince shortlog to count it for anything. :)

So this series adds support for counting trailers to shortlog. You can
do a number of fun things with it, like:

    # credit reviewers
    git shortlog -ns --group=trailer:reviewed-by

    # credit authors and co-authors equally
    git shortlog -ns --group=author \
                     --group=trailer:co-authored-by

    # see who helps whom
    git shortlog --format="...helped %an on %as" \
                 --group=trailer:helped-by

If some of this looks familiar, it's because I sent the early patches
years ago. But I won't even bother linking to it; I cleaned up quite a
few rough edges since then, so it's not really worth looking at.

  [1/8]: shortlog: change "author" variables to "ident"
  [2/8]: shortlog: refactor committer/author grouping
  [3/8]: trailer: add interface for iterating over commit trailers
  [4/8]: shortlog: match commit trailers with --group
  [5/8]: shortlog: de-duplicate trailer values
  [6/8]: shortlog: rename parse_stdin_ident()
  [7/8]: shortlog: parse trailer idents
  [8/8]: shortlog: allow multiple groups to be specified

 Documentation/git-shortlog.txt |  29 +++++
 builtin/log.c                  |   1 +
 builtin/shortlog.c             | 218 +++++++++++++++++++++++++++++----
 shortlog.h                     |   8 +-
 t/t4201-shortlog.sh            | 141 +++++++++++++++++++++
 trailer.c                      |  36 ++++++
 trailer.h                      |  44 ++++++-
 7 files changed, 447 insertions(+), 30 deletions(-)

-Peff

Comments

Derrick Stolee Sept. 25, 2020, 2:27 p.m. UTC | #1
On 9/25/2020 3:01 AM, Jeff King wrote:
> Somebody mentioned at the inclusion summit that it would be nice for
> mentoring/pairing relationships if we could more easily give credit to
> multiple authors of a commit. When people ask about adding multiple
> "author" headers, we usually recommend that they use a "co-authored-by"
> trailer. But you can't convince shortlog to count it for anything. :)

This discussion was worthwhile, and could even have measurable effects
on this community, depending on how Junio creates the list of
contributors for the release notes.

> So this series adds support for counting trailers to shortlog. You can
> do a number of fun things with it, like:
> 
>     # credit reviewers
>     git shortlog -ns --group=trailer:reviewed-by
> 
>     # credit authors and co-authors equally
>     git shortlog -ns --group=author \
>                      --group=trailer:co-authored-by
> 
>     # see who helps whom
>     git shortlog --format="...helped %an on %as" \
>                  --group=trailer:helped-by

I built Git with these patches and played around with these and
other options (such as `--group=author --group=committer`). I
could not find any bugs or other ways to improve these patches.

Thanks,
-Stolee
Junio C Hamano Sept. 25, 2020, 4:57 p.m. UTC | #2
Jeff King <peff@peff.net> writes:

> Somebody mentioned at the inclusion summit that it would be nice for
> mentoring/pairing relationships if we could more easily give credit to
> multiple authors of a commit. When people ask about adding multiple
> "author" headers, we usually recommend that they use a "co-authored-by"
> trailer. But you can't convince shortlog to count it for anything. :)
>
> So this series adds support for counting trailers to shortlog. You can
> do a number of fun things with it, like:
>
>     # credit reviewers
>     git shortlog -ns --group=trailer:reviewed-by
>
>     # credit authors and co-authors equally
>     git shortlog -ns --group=author \
>                      --group=trailer:co-authored-by
>
>     # see who helps whom
>     git shortlog --format="...helped %an on %as" \
>                  --group=trailer:helped-by
>
> If some of this looks familiar, it's because I sent the early patches
> years ago. But I won't even bother linking to it; I cleaned up quite a
> few rough edges since then, so it's not really worth looking at.

Fun stuff.  I like the idea.

Thanks.


>
>   [1/8]: shortlog: change "author" variables to "ident"
>   [2/8]: shortlog: refactor committer/author grouping
>   [3/8]: trailer: add interface for iterating over commit trailers
>   [4/8]: shortlog: match commit trailers with --group
>   [5/8]: shortlog: de-duplicate trailer values
>   [6/8]: shortlog: rename parse_stdin_ident()
>   [7/8]: shortlog: parse trailer idents
>   [8/8]: shortlog: allow multiple groups to be specified
>
>  Documentation/git-shortlog.txt |  29 +++++
>  builtin/log.c                  |   1 +
>  builtin/shortlog.c             | 218 +++++++++++++++++++++++++++++----
>  shortlog.h                     |   8 +-
>  t/t4201-shortlog.sh            | 141 +++++++++++++++++++++
>  trailer.c                      |  36 ++++++
>  trailer.h                      |  44 ++++++-
>  7 files changed, 447 insertions(+), 30 deletions(-)
>
> -Peff