Re: [PATCH 5/5] diff: properly error out when combining multiple pickaxe options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 3, 2018, 22:08 UTC
- Message-ID
- <xmqq7esyh9ym.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20180103004624.222528-6-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
;
Show 10 quoted lines
> + count = 0;
> +
> + if (options->pickaxe_opts & DIFF_PICKAXE_KIND_S)
> + count++;
> + if (options->pickaxe_opts & DIFF_PICKAXE_KIND_G)
> + count++;
> + if (options->pickaxe_opts & DIFF_PICKAXE_KIND_OBJFIND)
> + count++;
> + if (count > 1)
> + die(_("-G, -S, --find-object are mutually exclusive"));I thought the reason you defined pickaxe-kind bitmask was so that you can mask this field to grab these (and only these) bits. Once you have that mask, you should be able to use HAS_MULTI_BITS() on the masked result without counting, no?