Re: Re* [PATCH v3 19/22] resolve_ref(): emit warnings for improperly-formatted references
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 12, 2011, 19:20 UTC
- Message-ID
- <7vipnu81al.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20111011230749.GA29785@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> We also look at ref_rev_parse_rules in shorten_unambiguous_ref. So even > with your patch, I still get the warning with: > > $ git branch config > $ git for-each-ref --format='%(refname:short)' refs/heads/ > > It looks like we also use it in remote.c:count_refspec_match, but I > haven't figured out if that can trigger a warning or not.
I do not think this is "do not trigger a warning" exercise. This is "we no longer consider names outside refs/ as potential magic refs unless they are all uppercase".
If the updated dwim_ref() says $GIT_DIR/frotz will no longer create ambiguity with $GIT_DIR/refs/heads/frotz, then refname_match() needs to know about it, and cause count_refspec_match() to say that "frotz" uniquely names "refs/heads/frotz".
The same stands for shorten_unambiguous_ref(). If $GIT_DIR/frotz no longer is ambiguous with $GIT_DIR/refs/heads/frotz, then %(refname:shrot) for refs/heads/frotz should yield "frotz", and we should not have to qualify it as "heads/frotz".