This is an archive of the discontinued LLVM Phabricator instance.

Add a toplevel .mailmap file
ClosedPublic

Authored by thakis on May 29 2021, 9:20 AM.

Details

Summary

See "Proposal: Adding a toplevel .mailmap file" on llvm-dev:
https://lists.llvm.org/pipermail/llvm-dev/2021-May/150741.html

Diff Detail

Event Timeline

thakis requested review of this revision.May 29 2021, 9:20 AM
thakis updated this revision to Diff 348637.
thakis created this revision.

mention git check-mailmap

thakis edited reviewers, added: rengolin; removed: jdoerfert.May 29 2021, 9:24 AM

Can you add your aliases right off the bat? I have to say I was confused by the git manual, maybe I'm not the only one. Would be nice to have an example to follow...

Can you add your aliases right off the bat? I have to say I was confused by the git manual, maybe I'm not the only one. Would be nice to have an example to follow...

I'll add it in a follow-up as soon as this is in; I'm sure there will be several examples in this file fairly quickly :)

rengolin accepted this revision.May 29 2021, 11:04 AM

Fair enough

This revision is now accepted and ready to land.May 29 2021, 11:04 AM

Thanks! I'll let this sit for a few more days and land this Wednesday if nobody else comments :)

mstorsjo added inline comments.
.mailmap
3

Maybe one can mention that this also can be useful for just canonicalizing/merging various spellings of the name even if they use just one email address.

thakis added inline comments.May 30 2021, 9:14 AM
.mailmap
3

I was trying to say that with "mapping … email addresses and names to a single canonical one". Do you have a suggestion for how to make that more clear?

Maybe we could add:

For example, if you commit as `random.person@example.com` but sometimes use "Rañdom Person" and sometimes "Random Person" as name and you want the former to be your canonical name, add

    Rañdom Person <random.person@example.com>

If you commit as both `random.person@example.com` and `ranp@example.com` and you want the former to be your canonical email address, add

  <random.person@example.com> <ranp@example.com>

Combinations of both are possible too, see https://git-scm.com/docs/gitmailmap for format details.

Would that help?

Concrete change suggestions for the text that's here are also very welcome :)

mstorsjo added inline comments.May 30 2021, 2:39 PM
.mailmap
3

That sounds very concrete and understandable to me, thanks! Yeah I didn't have any good suggestions - I found it hard to consisely explain what I meant in my previous comment :-)

thakis updated this revision to Diff 348764.May 31 2021, 4:02 AM

add example

thakis marked an inline comment as done.May 31 2021, 4:02 AM
thakis added inline comments.
.mailmap
3

added

thakis marked an inline comment as done.May 31 2021, 5:24 AM
fhahn accepted this revision.Jun 1 2021, 2:06 AM
fhahn added a subscriber: fhahn.

That seems super useful, thanks for the patch! LGTM!

mstorsjo accepted this revision.Jun 1 2021, 2:11 AM

+1, looks great to me now, too.

This revision was landed with ongoing or failed builds.Jun 2 2021, 3:29 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2021, 3:29 AM
mstorsjo added inline comments.Jun 2 2021, 5:04 AM
.mailmap
24

Sorted - with which rule? :-) According to the email address only, or based on the first alphanumerical chars on the line (realname if set, otherwise email)?

thakis added inline comments.Jun 4 2021, 8:50 AM
.mailmap
24

Good question. I would've said "whatever :sort does" but I guess it's nice to keep entries for one person together?

But it's already not sorted even with email-only entries, so maybe we should just remove this line *shrug*

24

https://github.com/torvalds/linux/blob/master/.mailmap looks pretty tidy so I guess using that rule ("by first non-< char") would work?

mstorsjo added inline comments.Jun 4 2021, 11:05 AM
.mailmap
24

Ok, that sounds like a decent rule.