I want a way to list all git authors that
- Is only since a given commit.
- Is unique.
These two are easy, and I’ve seen some solutions to this online, most using git log --format. But none that I saw fits the additional requirements:
- Is ordered by commit date. So if John Smith committed before Aaron Meurer, his name should appear before mine (I’m Aaron Meurer).
- Respects .mailmap. As far as I can tell, only
git shortlogdoes this, and it gives a bunch of extra stuff that I don’t want. But maybe I’m wrong. Or maybe those of you who are more handy withsedand friends than I am would just use that.
(by the way, how do I make Markdown not restart the numbering?)
I also want a way to order it by last name, but this is relatively easy.
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
I suspect you could pipe it through something that does a hash-table based deduplication, a perl oneliner would be trivial: