-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
It would be nice to use git config to get the mailmap path, as determined by git. Currently it's hard-coded to .mailmap at the top of the repository, ignoring what's set by mailmap.file (see git-config(1)).
Here's an example. Let's say I have a couple of repositories in ~/projects/, like this:
[me@pc ~]$ tree -Fa
./
├── .gitconfig
└── projects/
├── .mailmap
├── my-app/
│ ├── .git/
│ └── ...
├── shared-lib/
│ ├── .git/
│ └── ...
└── team-website/
├── .git/
└── ...With this in my ~/.gitconfig:
[mailmap]
file = ~/projects/.mailmapWith this setup, I can share a common .mailmap file across projects. Conveniently, git provides a way to get this value in a machine-readable way:
[me@pc ~/projects/my-app]$ git config get --default=.mailmap --type=path mailmap.file
/home/me/projects/.mailmap--default=.mailmap: Use.mailmapas the default value if git can't determine what it should be--type=path: Resolve~,$HOME, and~usershorthands to their respective values
Reading through the docs again however, I'm realizing that to properly handle mailmap files, git will merge them from multiple sources (see git-config(1): mailmap.file), so it could get complicated quickly, but this could provide a useful start.
Metadata
Metadata
Assignees
Labels
No labels