blob: 4a8c276529a574355185adf3c77dede6fbd94267 [file] [log] [blame]
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +01001If the file `.mailmap` exists at the toplevel of the repository, or at
Jeff Kingd5422b02012-12-13 08:08:12 -05002the location pointed to by the mailmap.file or mailmap.blob
3configuration options, it
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +01004is 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
David J. Mellorb89510f2009-03-16 23:16:16 -07009commit (enclosed by '<' and '>') to map to the name. For example:
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010010--
11 Proper Name <commit@email.xx>
12--
13
David J. Mellorb89510f2009-03-16 23:16:16 -070014The more complex forms are:
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010015--
16 <proper@email.xx> <commit@email.xx>
17--
David J. Mellorb89510f2009-03-16 23:16:16 -070018which allows mailmap to replace only the email part of a commit, and:
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010019--
20 Proper Name <proper@email.xx> <commit@email.xx>
21--
22which allows mailmap to replace both the name and the email of a
David J. Mellorb89510f2009-03-16 23:16:16 -070023commit matching the specified commit email address, and:
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010024--
25 Proper 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
John Keepingf430ed82012-12-16 14:00:29 +000050Note how there is no need for an entry for `<jane@laptop.(none)>`, because the
David J. Mellorb89510f2009-03-16 23:16:16 -070051real name of that author is already correct.
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010052
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
David J. Mellorb89510f2009-03-16 23:16:16 -070065Then you might want a `.mailmap` file that looks like:
Marius Storm-Olsen7d48e9e2009-02-08 15:34:31 +010066------------
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
David J. Mellorb89510f2009-03-16 23:16:16 -070075the email address.