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.
Asked
Active
Viewed 189 times
1 Answers
1
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.

Romain Valeri
- 19,645
- 3
- 36
- 61
-
I just need to check if the file has valid syntax (with pointers to invalid lines, if any). How this approach would help? – planetp Oct 24 '19 at 12:31
-
Hmm, I might have misunderstood your needs, I thought you were trying to spot potentially remaining untransformed names/emails... but you're right, there should be an easier way to just do a formal syntax check. – Romain Valeri Oct 24 '19 at 12:56