From: "Joakim Tjernlund" <joakim.tjernlund@transmode.se>
To: "'Steffen Prohaska'" <prohaska@zib.de>,
"'Johannes Schindelin'" <Johannes.Schindelin@gmx.de>
Cc: "'git'" <git@vger.kernel.org>
Subject: RE: git push bug?
Date: Sat, 20 Oct 2007 13:52:05 +0200 [thread overview]
Message-ID: <001601c8130f$a3174eb0$5267a8c0@Jocke> (raw)
In-Reply-To: <5513C211-DE33-411C-8EE6-2259B41DC3EA@zib.de>
> -----Original Message-----
> From: Steffen Prohaska [mailto:prohaska@zib.de]
> Sent: den 20 oktober 2007 10:30
> To: Johannes Schindelin
> Cc: Joakim Tjernlund; git
> Subject: Re: git push bug?
>
>
> On Oct 18, 2007, at 11:58 PM, Johannes Schindelin wrote:
>
> >
> > On Thu, 18 Oct 2007, Steffen Prohaska wrote:
> >
> >> On Oct 18, 2007, at 6:21 PM, Johannes Schindelin wrote:
> >>
> >>> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:
> >>>
> >>>> Seems like it is a bit too easy to make mistakes here.
> Why can I
> >>>> delete
> >>>> a branch with :linus but not create one with linus:linus?
> >>>
> >>> I wonder why you bother with the colon at all. Just
> >>>
> >>> git push <remote> linus
> >>>
> >>> and be done with it. The colon is only there to play
> interesting
> >>> games,
> >>> not something as simple as "push this branch" or "push this tag".
> >>
> >> But you need a full refspec starting with 'refs/heads/' if you
> >> want to
> >> create a new branch on the remote side.
> >
> > No. Not if the name is the same on the local side.
>
> You're right. The documentation of git-send-pack says what you're
> saying:
>
> '''
> When one or more <ref> are specified explicitly, it can be either a
> single pattern, or a pair of such pattern separated by a colon
> ":" (this means that a ref name cannot have a colon in it). A single
> pattern <name> is just a shorthand for <name>:<name>
> '''
>
> Here it says that <name> is a shorthand for <name>:<name>.
> An later it states
>
> '''
> If <dst> does not match any remote ref, either
> * it has to start with "refs/"; <dst> is used as the destination
> literally in this case.
> * <src> == <dst> and the ref that matched the <src> must not
> exist in the set of remote refs; the ref matched <src> locally is
> used as the name of the destination.
> '''
>
> If <src> == <dst> then <dst> will be created even if it didn't exist.
>
> I think the current implementation though is a bit different.
> It will created a new branch for a colon-less refspec, that is
>
> git push origin work/topic
>
> will create a new ref on the remote. But
>
> git push origin work/topic:work/topic
>
> will _not_.
>
>
> Until you corrected me, I believed that new branches will never
> be created on the remote side unless a full ref is used. That is
> I expected that only
>
> git push origin refs/heads/work/topic
>
> would work.
>
> I thought this would be another safety net -- kind of a reminder
> not to push the wrong branch by accident.
>
> I still like the idea, but apparently git didn't ever support what
> I thought it would.
>
> Maybe adding some command line flags making the different tasks
> explicit could help:
>
> git push --create origin work/new-topic
> git push --delete origin work/old-topic
> git push --non-standard origin refs/funny/ref
This makes much more sense than the current method, thanks.
Jocke
next prev parent reply other threads:[~2007-10-20 12:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 14:50 git push bug? Joakim Tjernlund
2007-10-18 15:14 ` Steffen Prohaska
2007-10-18 16:01 ` Joakim Tjernlund
2007-10-18 16:10 ` Joakim Tjernlund
2007-10-19 0:49 ` Shawn O. Pearce
2007-10-18 16:13 ` Steffen Prohaska
2007-10-18 16:21 ` Johannes Schindelin
2007-10-18 16:31 ` Joakim Tjernlund
2007-10-18 22:00 ` Johannes Schindelin
2007-10-19 14:47 ` Joakim Tjernlund
2007-10-19 17:24 ` Johannes Schindelin
2007-10-19 18:50 ` Joakim Tjernlund
2007-10-19 22:46 ` Johannes Schindelin
2007-10-20 12:05 ` Jan Hudec
2007-10-18 16:55 ` Steffen Prohaska
2007-10-18 21:58 ` Johannes Schindelin
2007-10-20 8:29 ` Steffen Prohaska
2007-10-20 8:38 ` Steffen Prohaska
2007-10-20 11:52 ` Joakim Tjernlund [this message]
2007-10-19 0:24 ` Shawn O. Pearce
2007-10-20 17:38 ` Joakim Tjernlund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001601c8130f$a3174eb0$5267a8c0@Jocke' \
--to=joakim.tjernlund@transmode.se \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=prohaska@zib.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).