Re: [PATCH] remote.c: use shorten_unambiguous_ref

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

 



On Tue, Apr 14, 2009 at 02:55:14PM +0200, Michael J Gruber wrote:

> >   const char *shorten_ref(const char *);
> >   const char *shorten_ref_unambiguous(const char *);
> > 
> > ? The implementations are quite different, with prettify_ref not really
> > respecting the ref lookup rules, but rather just considering a few
> > pre-determined bits of the hierarchy as uninteresting. It shouldn't be
> > that hard to have them both use the same implementation, like:
> > 
> >   const char *shorten_ref(const char *, int unambiguous);
> 
> Should I rebase this on top of Bert's newer patch (which has the
> signature you suggest)? Currently I don't see any of them in.

It has the same signature, but the meanings are different. My flag meant
"should we bother looking at ambiguity at all?" whereas Bert's flag is
about "how strictly should we be counting ambiguity?".

So really there are three levels, which implies an enum (with none,
loose, and strict). However, calling it with a tri-state flag would be
less convenient, since your logic for the flag is:

  if (we are shortening something non-local)
    flag = none;
  else if (core.warn_ambiguous_refs is not set)
    flag = loose;
  else
    flag = strict;

So you really want to pass the two bits of information separately.

-Peff
--
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]