Re: Friendly refspecs

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

 



On Tue, 15 Apr 2008, Jeff King wrote:

> On Sun, Apr 13, 2008 at 12:31:02PM +0300, Teemu Likonen wrote:
> 
> > There is still one thing (at least) that I don't quite understand. It's
> > about "git push". When I do
> > 
> >   $ git push <remote> <branch>
> > 
> > the refs/heads/<branch> is updated or created on the remote side. But if
> > I do
> > 
> >   $ git push <remote> <branch1>:<branch2>
> > 
> > the refs/heads/<branch2> is not automatically created. Why there is need
> > to say "<branch1>:refs/heads/<branch2>" to make it work if <branch2>
> > does not exist? The 'git push' manual says something vague about branch
> > not matching (?). What does it mean?
> 
> This happens because "git push <remote> <branch>" is expanded locally to
> "git push <remote> <branch>:<branch>", but <branch> is first expanded
> into refs/heads/<branch>.
> 
> The latter uses the explicit refspec <branch2> which doesn't get
> expanded, since it doesn't exist at all, and so we can't deduce the type
> (e.g., refs/heads versus refs/tags).
> 
> ISTR some discussion in the past few months about using the type of
> <branch1> to guess the type of <branch2>, but it seems not to have gone
> anywhere.
> 
> Daniel, were you working on this?

I was only working on making "HEAD" expand to HEAD:<current branch>. I 
think that the matching type is only most likely what you want, not 
certainly enough to just do it. I'd say that push should suggest it, but 
not actually do it automatically, or possibly require -f to do it without 
the full name.

	-Daniel
*This .sig left intentionally blank*
--
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]

  Powered by Linux