diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-09-29 11:41:28 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-29 11:41:14 -0700 |
commit | 72fd13f71c18b438ca3e482c126bcbcaa2dac650 (patch) | |
tree | 8b9d4b67161ee6eb9ef8a62b175278c69a6e8ba3 /t/t7810-grep.sh | |
parent | ad4813b3c2513c5dc7e84305ab8a393b32124977 (diff) | |
download | git-72fd13f71c18b438ca3e482c126bcbcaa2dac650.tar.gz |
revision: add --grep-reflog to filter commits by reflog messages
Similar to --author/--committer which filters commits by author and
committer header fields. --grep-reflog adds a fake "reflog" header to
commit and a grep filter to search on that line.
All rules to --author/--committer apply except no timestamp stripping.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-x | t/t7810-grep.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 30eaa9a54b..3a5d0fd770 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -546,6 +546,32 @@ 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 with multiple --grep uses union' ' git log --grep=i --grep=r --format=%s >actual && { |