Re: Friendly refspecs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Tuesday, April 22, 2008 - 1:12 pm

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


Yes.


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Friendly refspecs, Junio C Hamano, (Tue Apr 22, 9:52 am)
Re: Friendly refspecs, Daniel Barkalow, (Tue Apr 22, 10:19 am)
Re: Friendly refspecs, Jeff King, (Tue Apr 22, 1:05 pm)
Re: Friendly refspecs, Jeff King, (Tue Apr 22, 1:12 pm)
Re: Friendly refspecs, Junio C Hamano, (Tue Apr 22, 1:45 pm)
Re: Friendly refspecs, Jeff King, (Tue Apr 22, 2:52 pm)
Re: Friendly refspecs, Teemu Likonen, (Tue Apr 22, 9:24 pm)
Re: Friendly refspecs, Junio C Hamano, (Tue Apr 22, 10:52 pm)
Re: Friendly refspecs, Andreas Ericsson, (Tue Apr 22, 11:24 pm)
Re: Friendly refspecs, Jeff King, (Wed Apr 23, 2:16 am)
Re: Friendly refspecs, Jeff King, (Wed Apr 23, 2:21 am)
Re: Friendly refspecs, Teemu Likonen, (Wed Apr 23, 4:15 am)