2021-01-13 04:17:45 +08:00
|
|
|
gitmailmap(5)
|
|
|
|
=============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
gitmailmap - Map author/committer names and/or E-Mail addresses
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2021-01-15 11:28:25 +08:00
|
|
|
$GIT_WORK_TREE/.mailmap
|
2021-01-13 04:17:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
2009-02-08 22:34:31 +08:00
|
|
|
If the file `.mailmap` exists at the toplevel of the repository, or at
|
2021-01-13 04:17:46 +08:00
|
|
|
the location pointed to by the `mailmap.file` or `mailmap.blob`
|
|
|
|
configuration options (see linkgit:git-config[1]), it
|
2009-02-08 22:34:31 +08:00
|
|
|
is used to map author and committer names and email addresses to
|
|
|
|
canonical real names and email addresses.
|
|
|
|
|
2021-01-13 04:17:45 +08:00
|
|
|
|
|
|
|
SYNTAX
|
|
|
|
------
|
|
|
|
|
2021-01-13 04:17:48 +08:00
|
|
|
The '#' character begins a comment to the end of line, blank lines
|
|
|
|
are ignored.
|
|
|
|
|
2009-02-08 22:34:31 +08:00
|
|
|
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
|
2009-03-17 14:16:16 +08:00
|
|
|
commit (enclosed by '<' and '>') to map to the name. For example:
|
2009-02-08 22:34:31 +08:00
|
|
|
--
|
|
|
|
Proper Name <commit@email.xx>
|
|
|
|
--
|
|
|
|
|
2009-03-17 14:16:16 +08:00
|
|
|
The more complex forms are:
|
2009-02-08 22:34:31 +08:00
|
|
|
--
|
|
|
|
<proper@email.xx> <commit@email.xx>
|
|
|
|
--
|
2009-03-17 14:16:16 +08:00
|
|
|
which allows mailmap to replace only the email part of a commit, and:
|
2009-02-08 22:34:31 +08:00
|
|
|
--
|
|
|
|
Proper Name <proper@email.xx> <commit@email.xx>
|
|
|
|
--
|
|
|
|
which allows mailmap to replace both the name and the email of a
|
2009-03-17 14:16:16 +08:00
|
|
|
commit matching the specified commit email address, and:
|
2009-02-08 22:34:31 +08:00
|
|
|
--
|
|
|
|
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.
|
|
|
|
|
2021-01-13 04:18:05 +08:00
|
|
|
Both E-Mails and names are matched case-insensitively. For example
|
2021-02-18 03:56:06 +08:00
|
|
|
this would also match the 'Commit Name <commit@email.xx>' above:
|
2021-01-13 04:18:05 +08:00
|
|
|
--
|
2021-02-18 03:56:06 +08:00
|
|
|
Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX>
|
2021-01-13 04:18:05 +08:00
|
|
|
--
|
2021-01-13 04:17:45 +08:00
|
|
|
|
2021-05-04 04:43:28 +08:00
|
|
|
NOTES
|
|
|
|
-----
|
|
|
|
|
|
|
|
Git does not follow symbolic links when accessing a `.mailmap` file in
|
|
|
|
the working tree. This keeps behavior consistent when the file is
|
|
|
|
accessed from the index or a tree versus from the filesystem.
|
|
|
|
|
2021-01-13 04:17:45 +08:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2021-01-13 04:18:01 +08:00
|
|
|
Your history contains commits by two authors, Jane
|
2009-02-08 22:34:31 +08:00
|
|
|
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
|
2021-01-13 04:18:01 +08:00
|
|
|
prefers her family name fully spelled out. A `.mailmap` file to
|
|
|
|
correct the names would look like:
|
2009-02-08 22:34:31 +08:00
|
|
|
|
|
|
|
------------
|
|
|
|
Joe R. Developer <joe@example.com>
|
2021-01-13 04:18:01 +08:00
|
|
|
Jane Doe <jane@example.com>
|
|
|
|
Jane Doe <jane@desktop.(none)>
|
2009-02-08 22:34:31 +08:00
|
|
|
------------
|
|
|
|
|
2021-02-18 03:56:06 +08:00
|
|
|
Note that there's no need to map the name for '<jane@laptop.(none)>' to
|
2021-01-13 04:18:01 +08:00
|
|
|
only correct the names. However, leaving the obviously broken
|
2021-02-18 03:56:06 +08:00
|
|
|
'<jane@laptop.(none)>' and '<jane@desktop.(none)>' E-Mails as-is is
|
2021-01-13 04:18:01 +08:00
|
|
|
usually not what you want. A `.mailmap` file which also corrects those
|
|
|
|
is:
|
2009-02-08 22:34:31 +08:00
|
|
|
|
2021-01-13 04:18:01 +08:00
|
|
|
------------
|
|
|
|
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:
|
2009-02-08 22:34:31 +08:00
|
|
|
|
|
|
|
------------
|
2021-01-13 04:18:01 +08:00
|
|
|
Joe <bugs@example.com>
|
|
|
|
Jane <bugs@example.com>
|
2009-02-08 22:34:31 +08:00
|
|
|
------------
|
|
|
|
|
2021-01-13 04:18:01 +08:00
|
|
|
A full `.mailmap` file which also handles those cases (an addition of
|
|
|
|
two lines to the above example) would be:
|
|
|
|
|
2009-02-08 22:34:31 +08:00
|
|
|
------------
|
2021-01-13 04:18:01 +08:00
|
|
|
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>
|
2009-02-08 22:34:31 +08:00
|
|
|
------------
|
|
|
|
|
2021-01-13 04:17:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
linkgit:git-check-mailmap[1]
|
|
|
|
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
|
|
|
Part of the linkgit:git[1] suite
|