mirror of
https://github.com/git/git.git
synced 2026-04-11 09:20:10 +02:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ad4813b3c2
commit
72fd13f71c
@@ -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 &&
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user