diff options
author | Antoine Pelisse <apelisse@gmail.com> | 2013-01-05 22:26:45 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-10 12:33:08 -0800 |
commit | d72fbe8111fbd3083d7063078c96eed27098490c (patch) | |
tree | 828ba8b9c30c7abd98d4a05504c30690ffe414d5 /t | |
parent | test: add test for --use-mailmap option (diff) | |
download | tgif-d72fbe8111fbd3083d7063078c96eed27098490c.tar.xz |
log: grep author/committer using mailmap
Currently you can use mailmap to display log authors and committers
but you can't use the mailmap to find commits with mapped values.
This commit allows you to run:
git log --use-mailmap --author mapped_name_or_email
git log --use-mailmap --committer mapped_name_or_email
Of course it only works if the --use-mailmap option is used.
The new name and email are copied only when necessary.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t4203-mailmap.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index db043dcec6..e16187fd17 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -248,11 +248,29 @@ Author: Other Author <other@author.xx> Author: Some Dude <some@dude.xx> Author: A U Thor <author@example.com> EOF + test_expect_success 'Log output with --use-mailmap' ' git log --use-mailmap | grep Author >actual && test_cmp expect actual ' +cat >expect <<\EOF +Author: Santa Claus <santa.claus@northpole.xx> +Author: Santa Claus <santa.claus@northpole.xx> +EOF + +test_expect_success 'Grep author with --use-mailmap' ' + git log --use-mailmap --author Santa | grep Author >actual && + test_cmp expect actual +' + +>expect + +test_expect_success 'Only grep replaced author with --use-mailmap' ' + git log --use-mailmap --author "<cto@coompany.xx>" >actual && + test_cmp expect actual +' + # git blame cat >expect <<\EOF ^OBJI (A U Thor DATE 1) one |