On Wed, Jan 22, 2014 at 1:46 PM, Junio C Hamano <gits...@pobox.com> wrote:
>> The new "find local ref" code will also complain loudly if you give an
>> ambiguous refname (eg you have both a tag and a branch with that same
>> name, and you don't specify "heads/name" or "tags/name").
> But this part might be a bit problematic.  $3=master will almost
> always have refs/heads/master and refs/remotes/origin/master listed
> because the call to "show-ref" comes before "rev-parse --verify",
> no?

Hmm. Yes.

It's done that way very much on purpose, to avoid the branch/tag
ambiguity (which we have had problems with), but you're right, it also
ends up being ambiguous wrt remote branches, which wasn't the
intention, and you're right, that is not acceptable.

Damn. I very much want to get the full ref-name (ie "master" should
become "refs/heads/master"), and I do want to avoid the branch/tag
ambiguity, but you're right, "show-ref" plus the subsequent "rev-parse
--verify" comes close but not quite close enough.

Any ideas? The hacky way is to do "| head -1" to take the first
show-ref output, and then check if you get a different result if you
re-do it using "show-ref --tags". But that sounds really excessively
hacky. Is there a good way to do it?

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to