diff --git a/diff.c b/diff.c index f9e86bca04..c1f47a7f01 100644 --- a/diff.c +++ b/diff.c @@ -4631,6 +4631,9 @@ void diff_setup_done(struct diff_options *options) if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S")); + if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) + die(_("---pickaxe-all and --find-object are mutually exclusive, use --pickaxe-all with -G and -S")); + /* * Most of the time we can say "there are changes" * only by checking if there are changed paths, but diff --git a/diff.h b/diff.h index 5e110d349b..82254396f9 100644 --- a/diff.h +++ b/diff.h @@ -558,6 +558,8 @@ int git_config_rename(const char *var, const char *value); DIFF_PICKAXE_KIND_OBJFIND) #define DIFF_PICKAXE_KINDS_G_REGEX_MASK (DIFF_PICKAXE_KIND_G | \ DIFF_PICKAXE_REGEX) +#define DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK (DIFF_PICKAXE_ALL | \ + DIFF_PICKAXE_KIND_OBJFIND) #define DIFF_PICKAXE_IGNORE_CASE 32 diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index 772c6c1a7c..16166ffd3e 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -63,6 +63,9 @@ test_expect_success 'usage' ' grep "mutually exclusive" err && test_expect_code 128 git log -Sstring --find-object=HEAD 2>err && + grep "mutually exclusive" err && + + test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err && grep "mutually exclusive" err '