Re: [PATCH] remote.c: use shorten_unambiguous_ref

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

 



On Thu, Apr 09, 2009 at 05:33:02PM +0200, Michael J Gruber wrote:

> Use the new shorten_unambiguous_ref() for simplifying the output of
> upstream branch names. This affects status and checkout.

Yeah, this is the spot I was thinking about when I mentioned "use it in
other places" earlier in the thread. So

Acked-by: Jeff King <peff@xxxxxxxx>

> I haven't seen more obvious place for using shorten_unambiguous_ref().
> prettify_ref() is a natural candidate but is mostly used for
> prettyfying refs on the remote side. git branch is covered by Jeff's
> patch already.

Hmm. I was thinking we might be able to just do away with prettify_ref,
but I didn't consider the fact that we need to prettify remote things. I
think you could still unambiguously prettify the local half of those
callsites, though.

Given that the two functions are closely related, should we perhaps
rename them to

  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);

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