diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-05 14:01:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-05 14:01:30 -0800 |
commit | 2043ce828e8020778c5460eaf7d5a207317c1c09 (patch) | |
tree | 51a85e0b9679bceb8fa2dfbae89d163e4884e28b /t | |
parent | Merge branch 'gh/gpg-doc-markup-fix' (diff) | |
parent | log: let --invert-grep only invert --grep (diff) | |
download | tgif-2043ce828e8020778c5460eaf7d5a207317c1c09.tar.xz |
Merge branch 'rs/log-invert-grep-with-headers'
"git log --invert-grep --author=<name>" used to exclude commits
written by the given author, but now "--invert-grep" only affects
the matches made by the "--grep=<pattern>" option.
* rs/log-invert-grep-with-headers:
log: let --invert-grep only invert --grep
Diffstat (limited to 't')
-rwxr-xr-x | t/t4202-log.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 6187b91f9f..5049559861 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -2090,4 +2090,23 @@ test_expect_success 'log --end-of-options' ' test_cmp expect actual ' +test_expect_success 'set up commits with different authors' ' + git checkout --orphan authors && + test_commit --author "Jim <jim@example.com>" jim_1 && + test_commit --author "Val <val@example.com>" val_1 && + test_commit --author "Val <val@example.com>" val_2 && + test_commit --author "Jim <jim@example.com>" jim_2 && + test_commit --author "Val <val@example.com>" val_3 && + test_commit --author "Jim <jim@example.com>" jim_3 +' + +test_expect_success 'log --invert-grep --grep --author' ' + cat >expect <<-\EOF && + val_3 + val_1 + EOF + git log --format=%s --author=Val --grep 2 --invert-grep >actual && + test_cmp expect actual +' + test_done |