Re: [PATCH v4 00/18] Extending the shelf-life of "git describe" output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> What happens if I set multiple flags? One or more of them will be
> ignored (you _could_ try to establish a hierarchy, for example that
> TREEISH is a superset of COMMITISH, but that could not handle the *_only
> cases, which really are mutually exclusive). IOW, I think these are not
> really flags but rather enum elements.

Yes, I was aware of that.  I counted five useful ones (see the new
ones near the tip of 'pu') but there may be others, so you cannot
fit in 2 bits and would need 3 bits.

> It is probably an OK trade-off since we are also stuffing true flags
> like GET_SHA1_QUIETLY in the same field, and we don't want to make the
> parameter list too unwieldy by splitting out the enum. But it might be
> worth throwing a comment into cache.h that a certain set of the flags
> are mutually exclusive. Or I guess you could mask off that part and make
> sure only one bit was set, which would catch the error at run-time. But
> I think a comment is probably sufficient.

I actually am thinking to move these bit assignments backto
sha1_name.c and make them private, as get_sha1_tree() and friends
are easier to understand public interface functions than
get_sha1_typish(... I_WANT_COMMIT|I_WANT_COMMITTISH|...).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]