Re: [1.8.0] Provide proper remote ref namespaces
- From
Jeff King <peff@peff.net>
- Date
- Feb 7, 2011, 20:56 UTC
- Message-ID
- <20110207205630.GA14768@sigill.intra.peff.net>
- In-Reply-To
- <alpine.LFD.2.00.1102071541460.14920@xanadu.home>
On Mon, Feb 07, 2011 at 03:51:55PM -0500, Nicolas Pitre wrote:
Show 10 quoted lines
> > Will it > > also apply to refs/heads/foo versus refs/remotes/*/tags/foo? In the > > final case, that does matter to "git push" (should the destination be in > > the head or tag namespace?). > > In such a case I'd say that head refs have precedence over tag refs, and > when that occurs then warn the user. And I wouldn't make a special > case for 'git push' here. Whether it is push or log, the head ref would > take precedence, and the user warned about existence of a tag with the > same name. Of course using "tag/foo" should be unambigous again.
I am fine with that, although it is the opposite of the current dwim_ref behavior (which warns on ambiguity but prefers tags). However, Junio has said that the current behavior was simply arbitrary.
Show 5 quoted lines
> > So the actual names of the ref can matter, > > and should probably be taken into account when deciding what is > > ambiguous. > > What happens today when you have refs/heads/foo and refs/tags/foo?
For dwim_ref, it prefers the tag and issues a warning. For git-push, it complains about the ambiguity and dies. For git checkout, we prefer the head. For git-tag, we prefer the tag (though I think that only matters for "git tag -d").
-Peff