Re: Friendly refspecs

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

 



On Tue, Apr 22, 2008 at 01:19:35PM -0400, Daniel Barkalow wrote:

> That's no good for people who make lightweight tags, since those will be 
> commits, and "git push <remote> tag:tag" would push refs/tags/tag to 
> refs/heads/tag.

Yes.

> But I think the proposal was for "git push $there $name:$name", where name 
> gets expanded locally to refs/heads/$name, which I think should probably 
> work. I think it should require $name to be unambiguous locally, though, 
> because it wouldn't be too unusual for people to end up with the same name 
> for a branch and a lightweight tag, and then try pushing that name, 
> expecting one or the other to get pushed.

Ambiguity is already handled when we resolve the left-hand side of the
refspec:

  $ git branch foo
  $ git tag foo
  $ git push origin foo
  error: src refspec foo matches more than one.
  fatal: The remote end hung up unexpectedly
  error: failed to push some refs to '/home/peff/foo/parent/.git'

I guess you could say something like:

  $ git branch dest
  $ git tag dest
  $ git push origin master:dest

and the "dest" here will become a branch. But that is because it has
nothing to do with your local refs called "dest": the right-hand side is
purely a remote matter. If the remote has an ambiguous "dest", then we
already handle that case:

  $ cd ../parent && git branch dest && git tag dest
  $ cd ../child && git push origin master:dest
  error: dst refspec dest matches more than one.
  fatal: The remote end hung up unexpectedly
  error: failed to push some refs to '/home/peff/foo/parent/.git'

-Peff
--
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