List of authors in git since a given commit

后端 未结 2 360
清歌不尽
清歌不尽 2021-02-05 07:03

I want a way to list all git authors that

  1. Is only since a given commit.
  2. Is unique.

These two are easy, and I\'ve seen some solutions to thi

2条回答
  •  -上瘾入骨i
    2021-02-05 08:02

    The following format specifiers will solve your second concern:

    %aN: author name (respecting .mailmap)
    %aE: author email (respecting .mailmap)
    %cN: committer name (respecting .mailmap)
    %cE: committer email (respecting .mailmap)

    So discounting the duplicate author part, you want something like

    git log .. --format="%aN <%aE>" --reverse
    

    I suspect you could pipe it through something that does a hash-table based deduplication, a perl oneliner would be trivial:

    git log .. --format="%aN <%aE>" --reverse | perl -e 'my %dedupe; while () { print unless $dedupe{$_}++}'
    

提交回复
热议问题