summaryrefslogtreecommitdiff
path: root/Documentation/gitmailmap.txt
blob: 052209b33b4ffa5c83b3aa49efc0e0e275fbdc62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
gitmailmap(5)
=============

NAME
----
gitmailmap - Map author/committer names and/or E-Mail addresses

SYNOPSIS
--------
$GIT_WORK_TREE/.mailmap


DESCRIPTION
-----------

If the file `.mailmap` exists at the toplevel of the repository, or at
the location pointed to by the `mailmap.file` or `mailmap.blob`
configuration options (see linkgit:git-config[1]), it
is used to map author and committer names and email addresses to
canonical real names and email addresses.


SYNTAX
------

The '#' character begins a comment to the end of line, blank lines
are ignored.

In the simple form, each line in the file consists of the canonical
real name of an author, whitespace, and an email address used in the
commit (enclosed by '<' and '>') to map to the name. For example:
--
	Proper Name <commit@email.xx>
--

The more complex forms are:
--
	<proper@email.xx> <commit@email.xx>
--
which allows mailmap to replace only the email part of a commit, and:
--
	Proper Name <proper@email.xx> <commit@email.xx>
--
which allows mailmap to replace both the name and the email of a
commit matching the specified commit email address, and:
--
	Proper Name <proper@email.xx> Commit Name <commit@email.xx>
--
which allows mailmap to replace both the name and the email of a
commit matching both the specified commit name and email address.

Both E-Mails and names are matched case-insensitively. For example
this would also match the 'Commit Name <commit@email.xx>' above:
--
Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX>
--

EXAMPLES
--------

Your history contains commits by two authors, Jane
and Joe, whose names appear in the repository under several forms:

------------
Joe Developer <joe@example.com>
Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com>
Jane Doe <jane@laptop.(none)>
Jane D. <jane@desktop.(none)>
------------

Now suppose that Joe wants his middle name initial used, and Jane
prefers her family name fully spelled out. A `.mailmap` file to
correct the names would look like:

------------
Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com>
Jane Doe <jane@desktop.(none)>
------------

Note that there's no need to map the name for 'jane@laptop.(none)' to
only correct the names. However, leaving the obviously broken
`<jane@laptop.(none)>' and '<jane@desktop.(none)>' E-Mails as-is is
usually not what you want. A `.mailmap` file which also corrects those
is:

------------
Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com> <jane@laptop.(none)>
Jane Doe <jane@example.com> <jane@desktop.(none)>
------------

Finally, let's say that Joe and Jane shared an E-Mail address, but not
a name, e.g. by having these two commits in the history generated by a
bug reporting system. I.e. names appearing in history as:

------------
Joe <bugs@example.com>
Jane <bugs@example.com>
------------

A full `.mailmap` file which also handles those cases (an addition of
two lines to the above example) would be:

------------
Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com> <jane@laptop.(none)>
Jane Doe <jane@example.com> <jane@desktop.(none)>
Joe R. Developer <joe@example.com> Joe <bugs@example.com>
Jane Doe <jane@example.com> Jane <bugs@example.com>
------------



SEE ALSO
--------
linkgit:git-check-mailmap[1]


GIT
---
Part of the linkgit:git[1] suite