-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mailmap.file as configurational option for mailmap location
This allows us to augment the repo mailmap file, and to use mailmap files elsewhere than the repository root. Meaning that the entries in mailmap.file will override the entries in "./.mailmap", should they match. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Marius Storm-Olsen
authored and
Junio C Hamano
committed
Feb 8, 2009
1 parent
88ccb9f
commit d551a48
Showing
10 changed files
with
147 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef MAILMAP_H | ||
#define MAILMAP_H | ||
|
||
int read_mailmap(struct string_list *map, const char *filename, char **repo_abbrev); | ||
int read_mailmap(struct string_list *map, char **repo_abbrev); | ||
int map_email(struct string_list *mailmap, const char *email, char *name, int maxlen); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/bin/sh | ||
|
||
test_description='.mailmap configurations' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
echo one >one && | ||
git add one && | ||
test_tick && | ||
git commit -m initial && | ||
echo two >>one && | ||
git add one && | ||
git commit --author "nick1 <bugs@company.xx>" -m second | ||
' | ||
|
||
cat >expect <<\EOF | ||
A U Thor (1): | ||
initial | ||
nick1 (1): | ||
second | ||
EOF | ||
|
||
test_expect_success 'No mailmap' ' | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
cat >expect <<\EOF | ||
Repo Guy (1): | ||
initial | ||
nick1 (1): | ||
second | ||
EOF | ||
|
||
test_expect_success 'default .mailmap' ' | ||
echo "Repo Guy <author@example.com>" > .mailmap && | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
# Using a mailmap file in a subdirectory of the repo here, but | ||
# could just as well have been a file outside of the repository | ||
cat >expect <<\EOF | ||
Internal Guy (1): | ||
second | ||
Repo Guy (1): | ||
initial | ||
EOF | ||
test_expect_success 'mailmap.file set' ' | ||
mkdir internal_mailmap && | ||
echo "Internal Guy <bugs@company.xx>" > internal_mailmap/.mailmap && | ||
git config mailmap.file internal_mailmap/.mailmap && | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
cat >expect <<\EOF | ||
External Guy (1): | ||
initial | ||
Internal Guy (1): | ||
second | ||
EOF | ||
test_expect_success 'mailmap.file override' ' | ||
echo "External Guy <author@example.com>" >> internal_mailmap/.mailmap && | ||
git config mailmap.file internal_mailmap/.mailmap && | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
cat >expect <<\EOF | ||
Repo Guy (1): | ||
initial | ||
nick1 (1): | ||
second | ||
EOF | ||
|
||
test_expect_success 'mailmap.file non-existant' ' | ||
rm internal_mailmap/.mailmap && | ||
rmdir internal_mailmap && | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
cat >expect <<\EOF | ||
A U Thor (1): | ||
initial | ||
nick1 (1): | ||
second | ||
EOF | ||
test_expect_success 'No mailmap files, but configured' ' | ||
rm .mailmap && | ||
git shortlog HEAD >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_done |