Proposal: Adding a toplevel .mailmap file

Hi,

I commit LLVM patches using two different email addresses. This means my changes show up as two lines in git shortlog -nes <path>, and git log --author=thakis only finds some of my changes. I know several others also use commit using different email addresses.

It’s possible to add a file .mailmap to the root of the repo that tells git to merge different email addresses to the same person for display purposes (https://git-scm.com/docs/gitmailmap). For example, if that file exists and contains

Nico Weber <thakis@chromium.org> <nicolasweber@gmx.de>

then git log --author=thakis will show all my commits.

I currently have that locally. Should we have this file checked in? Everybody who wanted could add their different aliases, and it gives people control over what they want to show as their primary email address. Linux for example has it checked in: https://github.com/torvalds/linux/blob/master/.mailmap

Nico

Offhand this seems like a good idea to me—as another example, someone might change companies and therefore email addresses, but it would be good to have a way to identify all contributions from the same person.

On the other hand… github IDs can have multiple addresses, is there a way to leverage that? But maybe github IDs are a github thing rather than a git thing, which makes that difficult?

–paulr

Yes, git shortlog and git log are local git concepts that don’t know about github.

+1, I have contributed with many different emails over the years… :slight_smile:

Since there were no concerns so far, I made https://reviews.llvm.org/D103360 for this.