diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-10-02 21:13:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-10-02 21:13:39 -0700 |
commit | fa11d7c87940154f3f6463353335c6010b13e5db (patch) | |
tree | a661388a8f6bf2e3adb17dde81a0fb15c3041e7b /t | |
parent | 5ce993a8126e4f428bc7862d4120b3ae81eb6a79 (diff) | |
parent | 38cfe915bfc3ea0dbcbedaa82c44460a2ada2f42 (diff) | |
download | git-fa11d7c87940154f3f6463353335c6010b13e5db.tar.gz |
Merge branch 'nd/grep-reflog'
Teach the commands from the "log" family the "--grep-reflog" option
to limit output by string that appears in the reflog entry when the
"--walk-reflogs" option is in effect.
* nd/grep-reflog:
revision: make --grep search in notes too if shown
log --grep-reflog: reject the option without -g
revision: add --grep-reflog to filter commits by reflog messages
grep: prepare for new header field filter
Diffstat (limited to 't')
-rwxr-xr-x | t/t7810-grep.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 91db352cc7..f698001c99 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -546,6 +546,36 @@ test_expect_success 'log grep (6)' ' test_cmp expect actual ' +test_expect_success 'log grep (7)' ' + git log -g --grep-reflog="commit: third" --pretty=tformat:%s >actual && + echo third >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (8)' ' + git log -g --grep-reflog="commit: third" --grep-reflog="commit: second" --pretty=tformat:%s >actual && + { + echo third && echo second + } >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (9)' ' + git log -g --grep-reflog="commit: third" --author="Thor" --pretty=tformat:%s >actual && + echo third >expect && + test_cmp expect actual +' + +test_expect_success 'log grep (9)' ' + git log -g --grep-reflog="commit: third" --author="non-existant" --pretty=tformat:%s >actual && + : >expect && + test_cmp expect actual +' + +test_expect_success 'log --grep-reflog can only be used under -g' ' + test_must_fail git log --grep-reflog="commit: third" +' + test_expect_success 'log with multiple --grep uses union' ' git log --grep=i --grep=r --format=%s >actual && { @@ -628,6 +658,18 @@ test_expect_success 'log --all-match --grep --grep --author takes intersection' test_cmp expect actual ' +test_expect_success 'log --author does not search in timestamp' ' + : >expect && + git log --author="$GIT_AUTHOR_DATE" >actual && + test_cmp expect actual +' + +test_expect_success 'log --committer does not search in timestamp' ' + : >expect && + git log --committer="$GIT_COMMITTER_DATE" >actual && + test_cmp expect actual +' + test_expect_success 'grep with CE_VALID file' ' git update-index --assume-unchanged t/t && rm t/t && |