How can I check the syntax of a Git mailmap file?

209 views Asked by At

How do I check the syntax of a Git mailmap file after adding/removing records? I want to make sure each line represents a valid mapping and not some garbage.

1

There are 1 answers

2
Romain Valeri On

You can compare the (sorted) list of the repo's authors with / without .mailmap with

git log --all --pretty=format:"%aN %aE" | sort -u

and

git log --all --pretty=format:"%an %ae" | sort -u

The first list should be taking your .mailmap into account and transform names/e-mails (provided you've set your config right with git config --global log.mailmap true), while the other uses raw commit data.