In [58899] a .mailmap
file was added to WordPress which instruct git
and git
-aware tooling to alias specific emails and names to a new identity. With this change it’s possible to combine multiple git
identities into a single one as well as fix any identities which may be broken in history.
For example, there was a time commits were brought over from Subversion and the emails associated in the git
commit followed the form <username@602fd350-edb4-49c9-b593-d223f7449a82>
. For each of these users, there might be other commits referencing <username@git.wordpress.org>
. Tools counting commits, history logs, annotations (blames), and others will make it seem as though the commits came from different people.
Further, committers change their names from time to time. Since git
history is immutable there’s no easy way to update old names without rewriting the entire project. The .mailmap
file provides the necessary mechanism to do this without interrupting that history.
Finally, committer A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component. names may be corrupted if they contain non-US-ASCII characters. This corruption can be resolved by adding an entry in the .mailmap
file correcting the name. This was the motivating case for introducing this file.
Most git
tools provide a way to see the underlying raw data, so to see the actual recorded names it’s usually possible to pass --no-use-mailmap
.
Would you like to review your own contributions?
If you run git shortlog -ens
from the wordpress-develop
repo then it will show a listing of commits per committer. If you see any problem with your name, duplicate name/email pairs, or would prefer to update your name, you can add new entries in the .mailmap
to make the appropriate adjustments.
# Review variations of my name before adding the .mailmap entry
git shortlog -ens | grep -iE 'dmsnell|dennis'
98 Dennis Snell <dmsnell@git.wordpress.org>
1 dmsnell <dmsnell@602fd350-edb4-49c9-b593-d223f7449a82>
echo "Dennis Snell <dmsnell@git.wordpres.org> dmsnell <dmsnell@602fd350-edb4-49c9-b593-d223f7449a82>" >> .mailmap
git shortlog -ens | grep -iE 'dmsnell|dennis'
99 Dennis Snell <dmsnell@git.wordpress.org>
#meta