blob: 4a8c276529a574355185adf3c77dede6fbd94267 [file] [log] [blame]
Junio C Hamano8bc410e2009-02-15 10:38:191If the file `.mailmap` exists at the toplevel of the repository, or at
Junio C Hamanoabad6da2013-01-06 09:06:322the location pointed to by the mailmap.file or mailmap.blob
3configuration options, it
Junio C Hamano8bc410e2009-02-15 10:38:194is used to map author and committer names and email addresses to
5canonical real names and email addresses.
6
7In the simple form, each line in the file consists of the canonical
8real name of an author, whitespace, and an email address used in the
Junio C Hamanofd83b8e2009-03-22 08:21:419commit (enclosed by '<' and '>') to map to the name. For example:
Junio C Hamano8bc410e2009-02-15 10:38:1910--
11Proper Name <commit@email.xx>
12--
13
Junio C Hamanofd83b8e2009-03-22 08:21:4114The more complex forms are:
Junio C Hamano8bc410e2009-02-15 10:38:1915--
16<proper@email.xx> <commit@email.xx>
17--
Junio C Hamanofd83b8e2009-03-22 08:21:4118which allows mailmap to replace only the email part of a commit, and:
Junio C Hamano8bc410e2009-02-15 10:38:1919--
20Proper Name <proper@email.xx> <commit@email.xx>
21--
22which allows mailmap to replace both the name and the email of a
Junio C Hamanofd83b8e2009-03-22 08:21:4123commit matching the specified commit email address, and:
Junio C Hamano8bc410e2009-02-15 10:38:1924--
25Proper Name <proper@email.xx> Commit Name <commit@email.xx>
26--
27which allows mailmap to replace both the name and the email of a
28commit matching both the specified commit name and email address.
29
30Example 1: Your history contains commits by two authors, Jane
31and Joe, whose names appear in the repository under several forms:
32
33------------
34Joe Developer <joe@example.com>
35Joe R. Developer <joe@example.com>
36Jane Doe <jane@example.com>
37Jane Doe <jane@laptop.(none)>
38Jane D. <jane@desktop.(none)>
39------------
40
41Now suppose that Joe wants his middle name initial used, and Jane
42prefers her family name fully spelled out. A proper `.mailmap` file
43would look like:
44
45------------
46Jane Doe <jane@desktop.(none)>
47Joe R. Developer <joe@example.com>
48------------
49
Junio C Hamanodb81b992012-12-21 23:49:1250Note how there is no need for an entry for `<jane@laptop.(none)>`, because the
Junio C Hamanofd83b8e2009-03-22 08:21:4151real name of that author is already correct.
Junio C Hamano8bc410e2009-02-15 10:38:1952
53Example 2: Your repository contains commits from the following
54authors:
55
56------------
57nick1 <bugs@company.xx>
58nick2 <bugs@company.xx>
59nick2 <nick2@company.xx>
60santa <me@company.xx>
61claus <me@company.xx>
62CTO <cto@coompany.xx>
63------------
64
Junio C Hamanofd83b8e2009-03-22 08:21:4165Then you might want a `.mailmap` file that looks like:
Junio C Hamano8bc410e2009-02-15 10:38:1966------------
67<cto@company.xx> <cto@coompany.xx>
68Some Dude <some@dude.xx> nick1 <bugs@company.xx>
69Other Author <other@author.xx> nick2 <bugs@company.xx>
70Other Author <other@author.xx> <nick2@company.xx>
71Santa Claus <santa.claus@northpole.xx> <me@company.xx>
72------------
73
74Use hash '#' for comments that are either on their own line, or after
Junio C Hamanofd83b8e2009-03-22 08:21:4175the email address.