diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-04-12 19:15:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-11 12:47:31 +0900 |
commit | 188e9e28c5287f3f160b5f14e3e551b1c55c7301 (patch) | |
tree | 0e347a10df0a33ea45c3e6fd8d86df6ad846c0bf /t | |
parent | pickaxe tests: add missing test for --no-pickaxe-regex being an error (diff) | |
download | tgif-188e9e28c5287f3f160b5f14e3e551b1c55c7301.tar.xz |
pickaxe: die when -G and --pickaxe-regex are combined
When the -G and --pickaxe-regex options are combined we simply ignore
the --pickaxe-regex option. Let's die instead as suggested by our
documentation, since -G is always a regex.
When --pickaxe-regex was added in d01d8c6782 (Support for pickaxe
matching regular expressions, 2006-03-29) only the -S option
existed. Then when -G was added in f506b8e8b5 (git log/diff: add
-G<regexp> that greps in the patch text, 2010-08-23) neither the
documentation for --pickaxe-regex was updated accordingly, nor was
something like this assertion added.
Since 5bc3f0b567 (diffcore-pickaxe doc: document -S and -G properly,
2013-05-31) we've claimed that --pickaxe-regex should only be used
with -S, but have silently tolerated combining it with -G, let's die
instead.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t4209-log-pickaxe.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index 532bb875f0..772c6c1a7c 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -66,6 +66,11 @@ test_expect_success 'usage' ' grep "mutually exclusive" err ' +test_expect_success 'usage: --pickaxe-regex' ' + test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && + grep "mutually exclusive" err +' + test_expect_success 'usage: --no-pickaxe-regex' ' cat >expect <<-\EOF && fatal: unrecognized argument: --no-pickaxe-regex |