forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sa/cat-file-mailmap' into seen
"git cat-file" learned an option to use the mailmap when showing commit and tag objects. * sa/cat-file-mailmap: cat-file: add mailmap support ident: rename commit_rewrite_person() to apply_mailmap_to_header() ident: move commit_rewrite_person() to ident.c revision: improve commit_rewrite_person()
- Loading branch information
Showing
6 changed files
with
184 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -932,7 +932,7 @@ test_expect_success 'find top-level mailmap from subdir' ' | |
test_cmp expect actual | ||
' | ||
|
||
test_expect_success SYMLINKS 'set up symlink tests' ' | ||
test_expect_success 'prepare for symlink/--use-mailmap tests' ' | ||
git commit --allow-empty -m foo --author="Orig <[email protected]>" && | ||
echo "New <[email protected]> <[email protected]>" >map && | ||
rm -f .mailmap | ||
|
@@ -963,4 +963,58 @@ test_expect_success SYMLINKS 'symlinks not respected in-tree' ' | |
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '--no-use-mailmap disables mailmap in cat-file' ' | ||
test_when_finished "rm .mailmap" && | ||
cat >.mailmap <<-EOF && | ||
A U Thor <[email protected]> Orig <[email protected]> | ||
EOF | ||
cat >expect <<-EOF && | ||
author Orig <[email protected]> | ||
EOF | ||
git cat-file --no-use-mailmap commit HEAD >log && | ||
sed -n "/^author /s/\([^>]*>\).*/\1/p" log >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '--use-mailmap enables mailmap in cat-file' ' | ||
test_when_finished "rm .mailmap" && | ||
cat >.mailmap <<-EOF && | ||
A U Thor <[email protected]> Orig <[email protected]> | ||
EOF | ||
cat >expect <<-EOF && | ||
author A U Thor <[email protected]> | ||
EOF | ||
git cat-file --use-mailmap commit HEAD >log && | ||
sed -n "/^author /s/\([^>]*>\).*/\1/p" log >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '--no-mailmap disables mailmap in cat-file for annotated tag objects' ' | ||
test_when_finished "rm .mailmap" && | ||
cat >.mailmap <<-EOF && | ||
Orig <[email protected]> C O Mitter <[email protected]> | ||
EOF | ||
cat >expect <<-EOF && | ||
tagger C O Mitter <[email protected]> | ||
EOF | ||
git tag -a -m "annotated tag" v1 && | ||
git cat-file --no-mailmap -p v1 >log && | ||
sed -n "/^tagger /s/\([^>]*>\).*/\1/p" log >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success '--mailmap enables mailmap in cat-file for annotated tag objects' ' | ||
test_when_finished "rm .mailmap" && | ||
cat >.mailmap <<-EOF && | ||
Orig <[email protected]> C O Mitter <[email protected]> | ||
EOF | ||
cat >expect <<-EOF && | ||
tagger Orig <[email protected]> | ||
EOF | ||
git tag -a -m "annotated tag" v2 && | ||
git cat-file --mailmap -p v2 >log && | ||
sed -n "/^tagger /s/\([^>]*>\).*/\1/p" log >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_done |