Re: [PATCH 01/10] get_sha1: detect buggy calls with multiple disambiguators

2016-09-26 Thread Junio C Hamano
Jeff King writes: >> Other than your reinvention of HAS_MULTI_BITS(), which has been with >> us since db7244bd ("parse-options new features.", 2007-11-07), this >> looks like a reasonable thing to do. > > Heh, I _thought_ we had something like that but couldn't find it. I >

Re: [PATCH 01/10] get_sha1: detect buggy calls with multiple disambiguators

2016-09-26 Thread Jeff King
On Mon, Sep 26, 2016 at 09:37:10AM -0700, Junio C Hamano wrote: > > We can do the check easily with some bit-twiddling, and as a > > bonus, the bit-mask of disambiguators will come in handy in > > a future patch. > > > > Signed-off-by: Jeff King > > --- > > Other than your

Re: [PATCH 01/10] get_sha1: detect buggy calls with multiple disambiguators

2016-09-26 Thread Junio C Hamano
Jeff King writes: > The get_sha1() family of functions takes a flags field, but > some of the flags are mutually exclusive. In particular, we > can only handle one disambiguating function, and the flags > quietly override each other. Let's instead detect these as > programming

[PATCH 01/10] get_sha1: detect buggy calls with multiple disambiguators

2016-09-26 Thread Jeff King
The get_sha1() family of functions takes a flags field, but some of the flags are mutually exclusive. In particular, we can only handle one disambiguating function, and the flags quietly override each other. Let's instead detect these as programming bugs. Technically some of the flags are