Re: [PATCH] for-each-ref: `:short` format for `refname`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 1, 2008, 21:28 UTC
- Message-ID
- <7v7i9vv9n2.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <36ca99e90809011410w646cc6eajb3063ea3501f173c@mail.gmail.com>
"Bert Wesarg" <bert.wesarg@googlemail.com> writes:
Show 12 quoted lines
> On Mon, Sep 1, 2008 at 21:10, Shawn O. Pearce <spearce@spearce.org> wrote: > ... >> You can still get ambiguous names. Avoiding them requires going >> through all refs and building their short forms, then using the >> full ref name for any ref which had more than one name shorten to >> the same string. Ugly, but implementable, and probably something >> that should be considered. > > What about: try the list backwards until the first match, than try the > matched part (this what %.*s matched) with the forward list, if both > give the same pattern, its not disambiguous. If not try the next > pattern backwards.
How does it catch the case where you have both 'xyzzy' branch and 'xyzzy' tag, which is the point of disambiguation issue Shawn raised?