summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-10-03 04:13:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-10-03 04:13:39 (GMT)
commitfa11d7c87940154f3f6463353335c6010b13e5db (patch)
treea661388a8f6bf2e3adb17dde81a0fb15c3041e7b /t
parent5ce993a8126e4f428bc7862d4120b3ae81eb6a79 (diff)
parent38cfe915bfc3ea0dbcbedaa82c44460a2ada2f42 (diff)
downloadgit-fa11d7c87940154f3f6463353335c6010b13e5db.zip
git-fa11d7c87940154f3f6463353335c6010b13e5db.tar.gz
git-fa11d7c87940154f3f6463353335c6010b13e5db.tar.bz2
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-xt/t7810-grep.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 91db352..f698001 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 &&