Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT .mailmap works per repo, but not in global, why?

Tags:

git

msysgit

I have a group of repos and I have a .mailmap file to combine user names.

My .mailmap file works for all the repos, when it is in the root of each.

I tried to put the file in my ~/.gitconfig file and it doesn't work. Im using Git for Windows and in my global .gitconfig file I added this:

>> git config --global mailmap.file "~/.mailmap"

Thats the command I used. Also tried the log shown below.

[log]
    mailmap = ~/.mailmap
[mailmap]
    file = C:/Documents and Settings/<username>/.mailmap

Both lead to the same file location, but it doesn't seem to honor this file when using git-shortlog

Any suggestions? Thanks.

EDIT Never did git this to work on windows. My hack-fix was to keep the mailmap file in the database, and to write it to each repository with a script.

like image 208
cwhelms Avatar asked Jun 29 '11 17:06

cwhelms


People also ask

What is Mailmap in git?

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

What is Mailmap?

The mailmap file is a simple text file that contains a mapping between the user names and the e-mail addresses of these users. The file is imported into the DataFabric Manager server database by using the dfm mailmap import command.


1 Answers

Looking into my .gitconfig, I see that all the windows paths are written with two backslashes like

[difftool "kdiff3"]
  path = C:\\Program Files\\KDiff3\\kdiff3.exe

This works for me.

Maybe you should write

[mailmap]
  file = C:\\Documents and Settings\\<username>\\.mailmap

to get things working. As an alternative, you could try the git-style path declaration like

[mailmap]
  file = /c/Documents\ and\ Settings/<username>/.mailmap
like image 130
eckes Avatar answered Oct 05 '22 02:10

eckes