{"thread":{"id":"10360","subject":"git push bug?","startedAt":"2007-10-18T14:50:40Z","lastAt":"2007-10-20T17:38:21Z","messageCount":21,"participants":["Joakim Tjernlund","Steffen Prohaska","Johannes Schindelin","Shawn O. Pearce","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56404","messageId":"1192719040.9433.5.camel@gentoo-jocke.transmode.se","threadId":"10360","inReplyTo":null,"subject":"git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-18T14:50:40Z","receivedAt":"2007-10-18T14:50:40Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"\nI thougth I could create a new branch on the server using:\n\n# > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\nWarning: No xauth data; using fake authentication data for X11 forwarding.\nupdating 'refs/linus' using 'refs/heads/linus'\n from 0000000000000000000000000000000000000000\n to bbf25010f1a6b761914430f5fca081ec8c7accd1\nGenerating pack...\nDone counting 0 objects.\nWriting 0 objects...\nTotal 0 (delta 0), reused 0 (delta 0)\nerror: refusing to create funny ref 'refs/linus' locally\nng refs/linus funny refname\nerror: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n\nbut that doesn't work. Am I doing this wrong?\n\ngit 1.5.3.4\n \n   Jocke\n"},{"id":"56405","messageId":"0DAC53EF-021D-441C-9520-9795AAB6DE54@zib.de","threadId":"10360","inReplyTo":"1192719040.9433.5.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-18T15:14:49Z","receivedAt":"2007-10-18T15:14:49Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote:\n\n>\n> I thougth I could create a new branch on the server using:\n>\n> # > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\n> Warning: No xauth data; using fake authentication data for X11  \n> forwarding.\n> updating 'refs/linus' using 'refs/heads/linus'\n>  from 0000000000000000000000000000000000000000\n>  to bbf25010f1a6b761914430f5fca081ec8c7accd1\n> Generating pack...\n> Done counting 0 objects.\n> Writing 0 objects...\n> Total 0 (delta 0), reused 0 (delta 0)\n> error: refusing to create funny ref 'refs/linus' locally\n> ng refs/linus funny refname\n> error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n>\n> but that doesn't work. Am I doing this wrong?\n\nInclude 'heads' in your remote refspec:\n\n    git push ssh://devsrv/var/git/os2kernel.git linus:refs/heads/linus\n\nYou may need to cleanup though. I'm not sure if the remote side\nalready created 'refs/linus'. The error message only indicates that\nlocally git refused to create the \"funny refname\". Pushing a refspec\nwith an empty local part should delete the \"funny refname\" on the\nremote:\n\n    git push ssh://devsrv/var/git/os2kernel.git :refs/linus\n\nDid this solve your problem?\n\n\tSteffen\n"},{"id":"56408","messageId":"1192723269.9433.21.camel@gentoo-jocke.transmode.se","threadId":"10360","inReplyTo":"0DAC53EF-021D-441C-9520-9795AAB6DE54@zib.de","subject":"Re: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-18T16:01:08Z","receivedAt":"2007-10-18T16:01:08Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"On Thu, 2007-10-18 at 17:14 +0200, Steffen Prohaska wrote:\n> On Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote:\n> \n> >\n> > I thougth I could create a new branch on the server using:\n> >\n> > # > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\n> > Warning: No xauth data; using fake authentication data for X11  \n> > forwarding.\n> > updating 'refs/linus' using 'refs/heads/linus'\n> >  from 0000000000000000000000000000000000000000\n> >  to bbf25010f1a6b761914430f5fca081ec8c7accd1\n> > Generating pack...\n> > Done counting 0 objects.\n> > Writing 0 objects...\n> > Total 0 (delta 0), reused 0 (delta 0)\n> > error: refusing to create funny ref 'refs/linus' locally\n> > ng refs/linus funny refname\n> > error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n> >\n> > but that doesn't work. Am I doing this wrong?\n> \n> Include 'heads' in your remote refspec:\n> \n>     git push ssh://devsrv/var/git/os2kernel.git linus:refs/heads/linus\n\nNow the push went OK:\ngit push  ssh://devsrv/var/git/os2kernel.git linus:refs/head/linus\nWarning: No xauth data; using fake authentication data for X11 forwarding.\nupdating 'refs/head/linus' using 'refs/heads/linus'\n  from 0000000000000000000000000000000000000000\n  to   bbf25010f1a6b761914430f5fca081ec8c7accd1\nGenerating pack...\nDone counting 0 objects.\nWriting 0 objects...\nTotal 0 (delta 0), reused 0 (delta 0)\nrefs/head/linus: 0000000000000000000000000000000000000000 -> bbf25010f1a6b761914430f5fca081ec8c7accd1\n\nbut there is no linus branch in the server repo!\n\nHowever:\n git push  ssh://devsrv/var/git/os2kernel.git linus\n\ncreates a linus branch in the server and \n\n git push  ssh://devsrv/var/git/os2kernel.git :linus\n Warning: No xauth data; using fake authentication data for X11 forwarding. \n deleting 'refs/heads/linus'\n refs/heads/linus: bbf25010f1a6b761914430f5fca081ec8c7accd1 -> deleted\n Everything up-to-date\n\ndeletes the linus branch on the server and so does\ngit push  ssh://devsrv/var/git/os2kernel.git :refs/heads/linus\n\nahh, now I see. When creating the branch the refspec needs to be refs/heads/linus,\nnot refs/head/linus\n\nrefs/head/linus will create just that on the server. git branch does not look\nthere, only in refs/heads\n\nSeems like it is a bit too easy to make mistakes here. Why can I delete\na branch with :linus but not create one with linus:linus?\nAlso confusing that git lets me create refs/head/linus when git branch\ncannot find it.\n\n Jocke\n\n> You may need to cleanup though. I'm not sure if the remote side\n> already created 'refs/linus'. The error message only indicates that\n> locally git refused to create the \"funny refname\". Pushing a refspec\n> with an empty local part should delete the \"funny refname\" on the\n> remote:\n> \n>     git push ssh://devsrv/var/git/os2kernel.git :refs/linus\n> \n> Did this solve your problem?\n> \n> \tSteffen\n> \n"},{"id":"56411","messageId":"1192723847.9433.25.camel@gentoo-jocke.transmode.se","threadId":"10360","inReplyTo":"1192723269.9433.21.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-18T16:10:47Z","receivedAt":"2007-10-18T16:10:47Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"On Thu, 2007-10-18 at 18:01 +0200, Joakim Tjernlund wrote:\n> On Thu, 2007-10-18 at 17:14 +0200, Steffen Prohaska wrote:\n> > On Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote:\n> > \n> > >\n> > > I thougth I could create a new branch on the server using:\n> > >\n> > > # > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\n> > > Warning: No xauth data; using fake authentication data for X11  \n> > > forwarding.\n> > > updating 'refs/linus' using 'refs/heads/linus'\n> > >  from 0000000000000000000000000000000000000000\n> > >  to bbf25010f1a6b761914430f5fca081ec8c7accd1\n> > > Generating pack...\n> > > Done counting 0 objects.\n> > > Writing 0 objects...\n> > > Total 0 (delta 0), reused 0 (delta 0)\n> > > error: refusing to create funny ref 'refs/linus' locally\n> > > ng refs/linus funny refname\n> > > error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n> > >\n> > > but that doesn't work. Am I doing this wrong?\n> > \n> > Include 'heads' in your remote refspec:\n> > \n> >     git push ssh://devsrv/var/git/os2kernel.git linus:refs/heads/linus\n> \n> Now the push went OK:\n> git push  ssh://devsrv/var/git/os2kernel.git linus:refs/head/linus\n> Warning: No xauth data; using fake authentication data for X11 forwarding.\n> updating 'refs/head/linus' using 'refs/heads/linus'\n>   from 0000000000000000000000000000000000000000\n>   to   bbf25010f1a6b761914430f5fca081ec8c7accd1\n> Generating pack...\n> Done counting 0 objects.\n> Writing 0 objects...\n> Total 0 (delta 0), reused 0 (delta 0)\n> refs/head/linus: 0000000000000000000000000000000000000000 -> bbf25010f1a6b761914430f5fca081ec8c7accd1\n> \n> but there is no linus branch in the server repo!\n> \n> However:\n>  git push  ssh://devsrv/var/git/os2kernel.git linus\n> \n> creates a linus branch in the server and \n> \n>  git push  ssh://devsrv/var/git/os2kernel.git :linus\n>  Warning: No xauth data; using fake authentication data for X11 forwarding. \n>  deleting 'refs/heads/linus'\n>  refs/heads/linus: bbf25010f1a6b761914430f5fca081ec8c7accd1 -> deleted\n>  Everything up-to-date\n> \n> deletes the linus branch on the server and so does\n> git push  ssh://devsrv/var/git/os2kernel.git :refs/heads/linus\n> \n> ahh, now I see. When creating the branch the refspec needs to be refs/heads/linus,\n> not refs/head/linus\n> \n> refs/head/linus will create just that on the server. git branch does not look\n> there, only in refs/heads\n> \n> Seems like it is a bit too easy to make mistakes here. Why can I delete\n> a branch with :linus but not create one with linus:linus?\n> Also confusing that git lets me create refs/head/linus when git branch\n> cannot find it.\n> \n>  Jocke\n\nBTW this does not work either:\n\ngit reset --hard HEAD^\ngit push -f  ssh://devsrv/var/git/os2kernel.git +master:master\nupdating 'refs/heads/master'\n  from 9c344d18d01221c8f25080cb58910e6b09efbf55\n  to   5761a9e5924b34615c748fba2dcb977ed04c1243\nGenerating pack...\nDone counting 0 objects.\nWriting 0 objects...\nTotal 0 (delta 0), reused 0 (delta 0)\nerror: denying non-fast forward refs/heads/master (you should pull first)\nng refs/heads/master non-fast forward\nerror: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n\nI thought the + in +master:master and the -f option should let me\ndo that.\n"},{"id":"56410","messageId":"CDE0C821-4CD9-46D4-8FC7-FC51B0D9C3D6@zib.de","threadId":"10360","inReplyTo":"1192723269.9433.21.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-18T16:13:11Z","receivedAt":"2007-10-18T16:13:11Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Oct 18, 2007, at 6:01 PM, Joakim Tjernlund wrote:\n\n> Seems like it is a bit too easy to make mistakes here. Why can I  \n> delete\n> a branch with :linus but not create one with linus:linus?\n> Also confusing that git lets me create refs/head/linus when git branch\n> cannot find it.\n\nI absolutely agree. But I'm not sure if those who use git since the\nancient days do agree too.\n\t\n\tSteffen\n"},{"id":"56413","messageId":"Pine.LNX.4.64.0710181720010.25221@racer.site","threadId":"10360","inReplyTo":"1192723269.9433.21.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-18T16:21:17Z","receivedAt":"2007-10-18T16:21:17Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n\n> Seems like it is a bit too easy to make mistakes here. Why can I delete \n> a branch with :linus but not create one with linus:linus?\n\nI wonder why you bother with the colon at all.  Just\n\n\tgit push <remote> linus\n\nand be done with it.  The colon is only there to play interesting games, \nnot something as simple as \"push this branch\" or \"push this tag\".\n\nCiao,\nDscho\n"},{"id":"56420","messageId":"1192725116.4954.7.camel@gentoo-jocke.transmode.se","threadId":"10360","inReplyTo":"Pine.LNX.4.64.0710181720010.25221@racer.site","subject":"Re: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-18T16:31:56Z","receivedAt":"2007-10-18T16:31:56Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"On Thu, 2007-10-18 at 17:21 +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> \n> > Seems like it is a bit too easy to make mistakes here. Why can I delete \n> > a branch with :linus but not create one with linus:linus?\n> \n> I wonder why you bother with the colon at all.  Just\n> \n> \tgit push <remote> linus\n> \n> and be done with it.  The colon is only there to play interesting games, \n> not something as simple as \"push this branch\" or \"push this tag\".\n\nFirst, I didn't know that I could do that.\nSecondly, I was also looking do v2.6.23:linus refspecs\n\n Jocke \n"},{"id":"56415","messageId":"9EEDF284-22BE-44BF-A9B8-116407784BEB@zib.de","threadId":"10360","inReplyTo":"Pine.LNX.4.64.0710181720010.25221@racer.site","subject":"Re: git push bug?","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-18T16:55:45Z","receivedAt":"2007-10-18T16:55:45Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Oct 18, 2007, at 6:21 PM, Johannes Schindelin wrote:\n\n> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n>\n>> Seems like it is a bit too easy to make mistakes here. Why can I  \n>> delete\n>> a branch with :linus but not create one with linus:linus?\n>\n> I wonder why you bother with the colon at all.  Just\n>\n> \tgit push <remote> linus\n>\n> and be done with it.  The colon is only there to play interesting  \n> games,\n> not something as simple as \"push this branch\" or \"push this tag\".\n\nBut you need a full refspec starting with 'refs/heads/' if you want to\ncreate a new branch on the remote side.\n\n\tSteffen\n"},{"id":"56431","messageId":"Pine.LNX.4.64.0710182258000.25221@racer.site","threadId":"10360","inReplyTo":"9EEDF284-22BE-44BF-A9B8-116407784BEB@zib.de","subject":"Re: git push bug?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-18T21:58:22Z","receivedAt":"2007-10-18T21:58:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 18 Oct 2007, Steffen Prohaska wrote:\n\n> On Oct 18, 2007, at 6:21 PM, Johannes Schindelin wrote:\n> \n> > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > \n> > > Seems like it is a bit too easy to make mistakes here. Why can I delete\n> > > a branch with :linus but not create one with linus:linus?\n> > \n> > I wonder why you bother with the colon at all.  Just\n> > \n> > \tgit push <remote> linus\n> > \n> > and be done with it.  The colon is only there to play interesting games,\n> > not something as simple as \"push this branch\" or \"push this tag\".\n> \n> But you need a full refspec starting with 'refs/heads/' if you want to\n> create a new branch on the remote side.\n\nNo.  Not if the name is the same on the local side.\n\nCiao,\nDscho\n"},{"id":"56432","messageId":"Pine.LNX.4.64.0710182259190.25221@racer.site","threadId":"10360","inReplyTo":"1192725116.4954.7.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-18T22:00:31Z","receivedAt":"2007-10-18T22:00:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n\n> On Thu, 2007-10-18 at 17:21 +0100, Johannes Schindelin wrote:\n> \n> > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > \n> > > Seems like it is a bit too easy to make mistakes here. Why can I \n> > > delete a branch with :linus but not create one with linus:linus?\n> > \n> > I wonder why you bother with the colon at all.  Just\n> > \n> > \tgit push <remote> linus\n> > \n> > and be done with it.  The colon is only there to play interesting \n> > games, not something as simple as \"push this branch\" or \"push this \n> > tag\".\n> \n> First, I didn't know that I could do that. Secondly, I was also looking \n> do v2.6.23:linus refspecs\n\n\nFirst, then our documentation could be better.  How?\n\nSecond, why not \"git checkout -b linus v2.6.23 && git push origin linus\"?\n\nCiao,\nDscho\n"},{"id":"56451","messageId":"20071019002451.GQ14735@spearce.org","threadId":"10360","inReplyTo":"0DAC53EF-021D-441C-9520-9795AAB6DE54@zib.de","subject":"Re: git push bug?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-19T00:24:51Z","receivedAt":"2007-10-19T00:24:51Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> wrote:\n> On Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote:\n> >\n> ># > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\n...\n> >error: refusing to create funny ref 'refs/linus' locally\n> >ng refs/linus funny refname\n> >error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n...\n> You may need to cleanup though. I'm not sure if the remote side\n> already created 'refs/linus'. The error message only indicates that\n> locally git refused to create the \"funny refname\".\n\nCute.  The error message \"error: refusing to create .. locally\"\nis actually coming from the remote site.  Locally here is\nactually remotely.  We *really* should change that.  Its l.169 of\nreceive-pack.c, which is only running on the remote side.  :)\n\nAnyone game to improve that error message?  Should be a pretty\nsimple patch.  One of the may low-hanging fruits in Git.\n\n-- \nShawn.\n"},{"id":"56455","messageId":"20071019004926.GR14735@spearce.org","threadId":"10360","inReplyTo":"1192723847.9433.25.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-19T00:49:26Z","receivedAt":"2007-10-19T00:49:26Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:\n> BTW this does not work either:\n> \n> git reset --hard HEAD^\n> git push -f  ssh://devsrv/var/git/os2kernel.git +master:master\n> updating 'refs/heads/master'\n>   from 9c344d18d01221c8f25080cb58910e6b09efbf55\n>   to   5761a9e5924b34615c748fba2dcb977ed04c1243\n> Generating pack...\n> Done counting 0 objects.\n> Writing 0 objects...\n> Total 0 (delta 0), reused 0 (delta 0)\n> error: denying non-fast forward refs/heads/master (you should pull first)\n> ng refs/heads/master non-fast forward\n> error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n> \n> I thought the + in +master:master and the -f option should let me\n> do that.\n\nYes, but its only on the client side.\n\nSee when we do a push the local client side determines if the push is\ngoing to be a fast-forward or not.  If it isn't then the git-push\nclient aborts before it even uploads data to the remote side.\nThe --force or + can be used to make the client side skip this\ncheck and just plow forward anyway.\n\nBut the remote side can also veto a non-fast-forward update.  By\ndefault it refuses to allow such updates as they can orphan commits\n(and thus potentially lose important work).  See the config option\nreceive.denyNonFastForwards; you may want to set this to true in\nthe remote side's config file.\n\n-- \nShawn.\n"},{"id":"56591","messageId":"1192805255.1875.25.camel@gentoo-jocke.transmode.se","threadId":"10360","inReplyTo":"Pine.LNX.4.64.0710182259190.25221@racer.site","subject":"Re: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-19T14:47:35Z","receivedAt":"2007-10-19T14:47:35Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"On Thu, 2007-10-18 at 23:00 +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> \n> > On Thu, 2007-10-18 at 17:21 +0100, Johannes Schindelin wrote:\n> > \n> > > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > > \n> > > > Seems like it is a bit too easy to make mistakes here. Why can I \n> > > > delete a branch with :linus but not create one with linus:linus?\n> > > \n> > > I wonder why you bother with the colon at all.  Just\n> > > \n> > > \tgit push <remote> linus\n> > > \n> > > and be done with it.  The colon is only there to play interesting \n> > > games, not something as simple as \"push this branch\" or \"push this \n> > > tag\".\n> > \n> > First, I didn't know that I could do that. Secondly, I was also looking \n> > do v2.6.23:linus refspecs\n> \n> \n> First, then our documentation could be better.  How?\n\nWell, it isn't clear to me how all this is supposed to work and\nwhat is bugs. Clearifying that would help.\n\nFor instances I did a push with v2.6.23:refs/heads/linus and now\nI got a branch with the SHA1 of v2.6.23 tag(0b8bc8b91cf6befea20fe78b90367ca7b61cfa0d)\nin it. Makes gitk display that branch as \"linus^{}\".\n\n> \n> Second, why not \"git checkout -b linus v2.6.23 && git push origin linus\"?\n\nAn extra checkout that takes time but works. Doesn't make the above\n\"weiredness\" go away though.\n\n Jocke\n\n> \n> Ciao,\n> Dscho\n> \n> \n"},{"id":"56604","messageId":"Pine.LNX.4.64.0710191920210.16728@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"10360","inReplyTo":"1192805255.1875.25.camel@gentoo-jocke.transmode.se","subject":"Re: git push bug?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-19T17:24:40Z","receivedAt":"2007-10-19T17:24:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 19 Oct 2007, Joakim Tjernlund wrote:\n\n> On Thu, 2007-10-18 at 23:00 +0100, Johannes Schindelin wrote:\n> > \n> > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > \n> > > First, I didn't know that I could do that. Secondly, I was also \n> > > looking do v2.6.23:linus refspecs\n> > \n> > \n> > First, then our documentation could be better.  How?\n> \n> Well, it isn't clear to me how all this is supposed to work and what is \n> bugs. Clearifying that would help.\n> \n> For instances I did a push with v2.6.23:refs/heads/linus and now I got a \n> branch with the SHA1 of v2.6.23 \n> tag(0b8bc8b91cf6befea20fe78b90367ca7b61cfa0d) in it. Makes gitk display \n> that branch as \"linus^{}\".\n\nIt strikes me as really odd that you would _want_ to create a branch \nremotely, that has _never_ existed locally.\n\n> > Second, why not \"git checkout -b linus v2.6.23 && git push origin \n> > linus\"?\n> \n> An extra checkout that takes time but works.\n\nNot only that: before trying to publish something, I would have expected \nyou to have that branch locally, and that you actually worked on it.\n\n> Doesn't make the above \"weiredness\" go away though.\n\nYes it does.\n\ngit checkout -b <branchname> resolves to the commit that the tag pointed \nto.  So it would not push a tag, which you did.\n\nOf course you could do what you planned to do, if you knew git better.  \nBut you are not familiar enough with git's inner workings yet, so I \nsuggest to stay with things for now that work _always_, and exactly as \nexpected.\n\nSuch as creating a branch locally, with exactly the name that you plan it \nto have remotely, and then pushing it with \"git push origin <branchname>\".  \nEasy as apple pie.\n\nCiao,\nDscho\n"},{"id":"56608","messageId":"000001c81280$ebc5c5e0$5267a8c0@Jocke","threadId":"10360","inReplyTo":"Pine.LNX.4.64.0710191920210.16728@wbgn129.biozentrum.uni-wuerzburg.de","subject":"RE: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-19T18:50:29Z","receivedAt":"2007-10-19T18:50:29Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"> -----Original Message-----\n> From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] \n> Sent: den 19 oktober 2007 19:25\n> To: Joakim Tjernlund\n> Cc: Steffen Prohaska; git\n> Subject: Re: git push bug?\n> \n> Hi,\n> \n> On Fri, 19 Oct 2007, Joakim Tjernlund wrote:\n> \n> > On Thu, 2007-10-18 at 23:00 +0100, Johannes Schindelin wrote:\n> > > \n> > > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > > \n> > > > First, I didn't know that I could do that. Secondly, I was also \n> > > > looking do v2.6.23:linus refspecs\n> > > \n> > > \n> > > First, then our documentation could be better.  How?\n> > \n> > Well, it isn't clear to me how all this is supposed to work \n> and what is \n> > bugs. Clearifying that would help.\n> > \n> > For instances I did a push with v2.6.23:refs/heads/linus \n> and now I got a \n> > branch with the SHA1 of v2.6.23 \n> > tag(0b8bc8b91cf6befea20fe78b90367ca7b61cfa0d) in it. Makes \n> gitk display \n> > that branch as \"linus^{}\".\n> \n> It strikes me as really odd that you would _want_ to create a branch \n> remotely, that has _never_ existed locally.\n\nIt strikes me as really odd that a core developers like yourself\nhasn't tried to justify/explain why push works as it does.\n\nAs I am trying to convince our dev. group here to move to git instead of subversion, I\nneed to learn how git works. Now I have gotten to the push function and I need\nto know what can be done with push and how, pitfalls too. As I go along I find behavior\nthat I find odd and report these to the list.\n\n git push <repo> v2.6.23:refs/heads/linus\nwill make a tag look like a branch\n\n git push <repo> linus:linus\nwon't let me create the remote branch linus but\n git push <repo> linus\nwill\n\n git push <repo> :linus\nOOPS, now I just deleted remote branch linus, no warning\n \n git push <repo> linus:refs/head/linus\ncreates a branch that is invisible(wont show in git branch -a)\n\n git push <repo> linus:refs/heads/newbranch\ncreates remote branch newbranch, but you have to know the magic words\nrefs/heads/ to do it.\n\nSe what I mean? \n\n> \n> > > Second, why not \"git checkout -b linus v2.6.23 && git push origin \n> > > linus\"?\n> > \n> > An extra checkout that takes time but works.\n> \n> Not only that: before trying to publish something, I would \n> have expected \n> you to have that branch locally, and that you actually worked on it.\n> \n> > Doesn't make the above \"weiredness\" go away though.\n> \n> Yes it does.\n\nNo it doesn't. If someone else in my group wants to create a branch they\nmight do the same mistakes as I did.\n\n> \n> git checkout -b <branchname> resolves to the commit that the \n> tag pointed \n> to.  So it would not push a tag, which you did.\n> \n> Of course you could do what you planned to do, if you knew \n> git better.  \n> But you are not familiar enough with git's inner workings yet, so I \n> suggest to stay with things for now that work _always_, and \n> exactly as \n> expected.\n> \n> Such as creating a branch locally, with exactly the name that \n> you plan it \n> to have remotely, and then pushing it with \"git push origin \n> <branchname>\".  \n> Easy as apple pie.\n> \n> Ciao,\n> Dscho\n> \n> \n> \n"},{"id":"56640","messageId":"Pine.LNX.4.64.0710192338400.25221@racer.site","threadId":"10360","inReplyTo":"000001c81280$ebc5c5e0$5267a8c0@Jocke","subject":"RE: git push bug?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-19T22:46:29Z","receivedAt":"2007-10-19T22:46:29Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 19 Oct 2007, Joakim Tjernlund wrote:\n\n> > From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] \n> > \n> > On Fri, 19 Oct 2007, Joakim Tjernlund wrote:\n> > \n> > > On Thu, 2007-10-18 at 23:00 +0100, Johannes Schindelin wrote:\n> > > > \n> > > > On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> > > > \n> > > > > First, I didn't know that I could do that. Secondly, I was also \n> > > > > looking do v2.6.23:linus refspecs\n> > > > \n> > > > \n> > > > First, then our documentation could be better.  How?\n> > > \n> > > Well, it isn't clear to me how all this is supposed to work and what \n> > > is bugs. Clearifying that would help.\n> > > \n> > > For instances I did a push with v2.6.23:refs/heads/linus and now I \n> > > got a branch with the SHA1 of v2.6.23 \n> > > tag(0b8bc8b91cf6befea20fe78b90367ca7b61cfa0d) in it. Makes gitk \n> > > display that branch as \"linus^{}\".\n> > \n> > It strikes me as really odd that you would _want_ to create a branch \n> > remotely, that has _never_ existed locally.\n> \n> It strikes me as really odd that a core developers like yourself\n> hasn't tried to justify/explain why push works as it does.\n\nWell, I explained that I think the \"src:dst\" way to specify things are not \nmeant for git newbies.  Don't use it.\n\ngit push <remote> <branchname> works exactly as advertised.  It pushes the \nspecified branch to the remote repository.\n\n> As I am trying to convince our dev. group here to move to git instead of \n> subversion, I need to learn how git works. Now I have gotten to the push \n> function and I need to know what can be done with push and how, pitfalls \n> too. As I go along I find behavior that I find odd and report these to \n> the list.\n> \n>  git push <repo> v2.6.23:refs/heads/linus\n> will make a tag look like a branch\n\nDon't use src:dest notation.\n\n>  git push <repo> linus:linus\n> won't let me create the remote branch linus\n\nDon't use src:dest notation.\n\n> but\n>  git push <repo> linus\n> will\n\nUse this.  This is good.\n\n>  git push <repo> :linus\n> OOPS, now I just deleted remote branch linus, no warning\n\nDon't use src:dest notation.\n\n>  git push <repo> linus:refs/head/linus\n> creates a branch that is invisible(wont show in git branch -a)\n\nDon't use src:dest notation.\n\n>  git push <repo> linus:refs/heads/newbranch\n> creates remote branch newbranch, but you have to know the magic words\n> refs/heads/ to do it.\n\nDon't use src:dest notation.\n\n> Se what I mean? \n\nYes.\n\nI hope you return the honour.\n\n> > > > Second, why not \"git checkout -b linus v2.6.23 && git push origin \n> > > > linus\"?\n> > > \n> > > An extra checkout that takes time but works.\n> > \n> > Not only that: before trying to publish something, I would have \n> > expected you to have that branch locally, and that you actually worked \n> > on it.\n> > \n> > > Doesn't make the above \"weiredness\" go away though.\n> > \n> > Yes it does.\n> \n> No it doesn't. If someone else in my group wants to create a branch they \n> might do the same mistakes as I did.\n\nYes, it does.  You no longer can push a tag onto a remote branch by \naccident.  Just don't use the src:dest notation.  Forget about it.  You \ndefinitely don't need it before you understand git better.\n\nHth,\nDscho\n"},{"id":"56682","messageId":"5513C211-DE33-411C-8EE6-2259B41DC3EA@zib.de","threadId":"10360","inReplyTo":"Pine.LNX.4.64.0710182258000.25221@racer.site","subject":"Re: git push bug?","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-20T08:29:59Z","receivedAt":"2007-10-20T08:29:59Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Oct 18, 2007, at 11:58 PM, Johannes Schindelin wrote:\n\n>\n> On Thu, 18 Oct 2007, Steffen Prohaska wrote:\n>\n>> On Oct 18, 2007, at 6:21 PM, Johannes Schindelin wrote:\n>>\n>>> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n>>>\n>>>> Seems like it is a bit too easy to make mistakes here. Why can I  \n>>>> delete\n>>>> a branch with :linus but not create one with linus:linus?\n>>>\n>>> I wonder why you bother with the colon at all.  Just\n>>>\n>>> \tgit push <remote> linus\n>>>\n>>> and be done with it.  The colon is only there to play interesting  \n>>> games,\n>>> not something as simple as \"push this branch\" or \"push this tag\".\n>>\n>> But you need a full refspec starting with 'refs/heads/' if you  \n>> want to\n>> create a new branch on the remote side.\n>\n> No.  Not if the name is the same on the local side.\n\nYou're right. The documentation of git-send-pack says what you're\nsaying:\n\n'''\nWhen one or more <ref> are specified explicitly, it can be either a  \nsingle pattern, or a pair of such pattern separated by a colon  \n\":\" (this means that a ref name cannot have a colon in it). A single  \npattern <name> is just a shorthand for <name>:<name>\n'''\n\nHere it says that <name> is a shorthand for <name>:<name>.\nAn later it states\n\n'''\nIf <dst> does not match any remote ref, either\n    * it has to start with \"refs/\"; <dst> is used as the destination  \nliterally in this case.\n    * <src> == <dst> and the ref that matched the <src> must not  \nexist in the set of remote refs; the ref matched <src> locally is  \nused as the name of the destination.\n'''\n\nIf <src> == <dst> then <dst> will be created even if it didn't exist.\n\nI think the current implementation though is a bit different.\nIt will created a new branch for a colon-less refspec, that is\n\n    git push origin work/topic\n\nwill create a new ref on the remote. But\n\n    git push origin work/topic:work/topic\n\nwill _not_.\n\n\nUntil you corrected me, I believed that new branches will never\nbe created on the remote side unless a full ref is used. That is\nI expected that only\n\n    git push origin refs/heads/work/topic\n\nwould work.\n\nI thought this would be another safety net -- kind of a reminder\nnot to push the wrong branch by accident.\n\nI still like the idea, but apparently git didn't ever support what\nI thought it would.\n\nMaybe adding some command line flags making the different tasks\nexplicit could help:\n\n     git push --create origin work/new-topic\n     git push --delete origin work/old-topic\n     git push --non-standard origin refs/funny/ref\n\nWe already have similar flags\n\n     --all: all branches\n     --tags: all tags\n     --force: force non-fast-forward.\n\nI haven't fully thought this through. Maybe I'll come up with a patch\nlater.\n\n\tSteffen\n"},{"id":"56683","messageId":"1216340A-9A44-49AC-9FF6-B289E8736893@zib.de","threadId":"10360","inReplyTo":"5513C211-DE33-411C-8EE6-2259B41DC3EA@zib.de","subject":"Re: git push bug?","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-10-20T08:38:04Z","receivedAt":"2007-10-20T08:38:04Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"Shawn,\nsp/push-refspec definitely needs more work (see below).\n\n\nOn Oct 20, 2007, at 10:29 AM, Steffen Prohaska wrote:\n\n>\n> On Oct 18, 2007, at 11:58 PM, Johannes Schindelin wrote:\n>\n>>\n>> On Thu, 18 Oct 2007, Steffen Prohaska wrote:\n>>>\n>>> But you need a full refspec starting with 'refs/heads/' if you  \n>>> want to\n>>> create a new branch on the remote side.\n>>\n>> No.  Not if the name is the same on the local side.\n>\n> You're right. The documentation of git-send-pack says what you're\n> saying:\n>\n> [...]\n>\n> Until you corrected me, I believed that new branches will never\n> be created on the remote side unless a full ref is used. That is\n> I expected that only\n>\n>    git push origin refs/heads/work/topic\n>\n> would work.\n>\n> I thought this would be another safety net -- kind of a reminder\n> not to push the wrong branch by accident.\n>\n> I still like the idea, but apparently git didn't ever support what\n> I thought it would.\n\nAnd I even fixed the behavior to match my expectation in a patch\nwhich made it to spearce/pu:\n\n\nd869233c62688742968663c4e8b5ff20a50a5011\n\n     push, send-pack: fix test if remote branch exists for colon-less  \nrefspec\n\n     A push must fail if the remote ref does not yet exist and the  \nrefspec\n     does not start with refs/. Remote refs must explicitly be  \ncreated with\n     their full name.\n\n     This commit adds some tests and fixes the existence check in  \nsend-pack.\n\n\nsp/push-refspec definitely needs some more work.\n\n\tSteffen\n"},{"id":"56694","messageId":"001601c8130f$a3174eb0$5267a8c0@Jocke","threadId":"10360","inReplyTo":"5513C211-DE33-411C-8EE6-2259B41DC3EA@zib.de","subject":"RE: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-20T11:52:05Z","receivedAt":"2007-10-20T11:52:05Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":" \n\n> -----Original Message-----\n> From: Steffen Prohaska [mailto:prohaska@zib.de] \n> Sent: den 20 oktober 2007 10:30\n> To: Johannes Schindelin\n> Cc: Joakim Tjernlund; git\n> Subject: Re: git push bug?\n> \n> \n> On Oct 18, 2007, at 11:58 PM, Johannes Schindelin wrote:\n> \n> >\n> > On Thu, 18 Oct 2007, Steffen Prohaska wrote:\n> >\n> >> On Oct 18, 2007, at 6:21 PM, Johannes Schindelin wrote:\n> >>\n> >>> On Thu, 18 Oct 2007, Joakim Tjernlund wrote:\n> >>>\n> >>>> Seems like it is a bit too easy to make mistakes here. \n> Why can I  \n> >>>> delete\n> >>>> a branch with :linus but not create one with linus:linus?\n> >>>\n> >>> I wonder why you bother with the colon at all.  Just\n> >>>\n> >>> \tgit push <remote> linus\n> >>>\n> >>> and be done with it.  The colon is only there to play \n> interesting  \n> >>> games,\n> >>> not something as simple as \"push this branch\" or \"push this tag\".\n> >>\n> >> But you need a full refspec starting with 'refs/heads/' if you  \n> >> want to\n> >> create a new branch on the remote side.\n> >\n> > No.  Not if the name is the same on the local side.\n> \n> You're right. The documentation of git-send-pack says what you're\n> saying:\n> \n> '''\n> When one or more <ref> are specified explicitly, it can be either a  \n> single pattern, or a pair of such pattern separated by a colon  \n> \":\" (this means that a ref name cannot have a colon in it). A single  \n> pattern <name> is just a shorthand for <name>:<name>\n> '''\n> \n> Here it says that <name> is a shorthand for <name>:<name>.\n> An later it states\n> \n> '''\n> If <dst> does not match any remote ref, either\n>     * it has to start with \"refs/\"; <dst> is used as the destination  \n> literally in this case.\n>     * <src> == <dst> and the ref that matched the <src> must not  \n> exist in the set of remote refs; the ref matched <src> locally is  \n> used as the name of the destination.\n> '''\n> \n> If <src> == <dst> then <dst> will be created even if it didn't exist.\n> \n> I think the current implementation though is a bit different.\n> It will created a new branch for a colon-less refspec, that is\n> \n>     git push origin work/topic\n> \n> will create a new ref on the remote. But\n> \n>     git push origin work/topic:work/topic\n> \n> will _not_.\n> \n> \n> Until you corrected me, I believed that new branches will never\n> be created on the remote side unless a full ref is used. That is\n> I expected that only\n> \n>     git push origin refs/heads/work/topic\n> \n> would work.\n> \n> I thought this would be another safety net -- kind of a reminder\n> not to push the wrong branch by accident.\n> \n> I still like the idea, but apparently git didn't ever support what\n> I thought it would.\n> \n> Maybe adding some command line flags making the different tasks\n> explicit could help:\n> \n>      git push --create origin work/new-topic\n>      git push --delete origin work/old-topic\n>      git push --non-standard origin refs/funny/ref\n\nThis makes much more sense than the current method, thanks.\n\n Jocke\n"},{"id":"56696","messageId":"20071020120543.GA19521@efreet.light.src","threadId":"10360","inReplyTo":"000001c81280$ebc5c5e0$5267a8c0@Jocke","subject":"Re: git push bug?","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-10-20T12:05:43Z","receivedAt":"2007-10-20T12:05:43Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Fri, Oct 19, 2007 at 20:50:29 +0200, Joakim Tjernlund wrote:\n> On den 19 oktober 2007 19:25, Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] wrote:\n> > It strikes me as really odd that you would _want_ to create a branch \n> > remotely, that has _never_ existed locally.\n> It strikes me as really odd that a core developers like yourself\n> hasn't tried to justify/explain why push works as it does.\n\nDscho it rarely kind to newbies.\n\n> As I am trying to convince our dev. group here to move to git instead of subversion, I\n> need to learn how git works. Now I have gotten to the push function and I need\n> to know what can be done with push and how, pitfalls too. As I go along I find behavior\n> that I find odd and report these to the list.\n> \n>  git push <repo> v2.6.23:refs/heads/linus\n> will make a tag look like a branch\n\nThat's becasue tags come in two flavors -- annotated and unannotated.\nAnnotated ones don't point to commits directly, but via 'tag' objects, that\ncontain description and usually signature.\n\nNow git push will simply assign a remote branch whatever value you give it.\nYou gave it a tag, so it assigned a tag.\n\n>  git push <repo> linus:linus\n> won't let me create the remote branch linus but\n>  git push <repo> linus\n> will\n\nBecause in the former you are not saying whether refs/heads/linus,\nrefs/tags/linus or something else (the fact that heads and tags are treated\nspecially by git does not mean refs can't have other subdirectories -- it\ncan).\n\nOn the other hand in the later it resolves the ref locally and uses the same\nname remotedly.\n\n>  git push <repo> :linus\n> OOPS, now I just deleted remote branch linus, no warning\n\nYour commands are quite obvious. No need for warning. (Besides, isn't there\na reflog?)\n\n>  git push <repo> linus:refs/head/linus\n> creates a branch that is invisible(wont show in git branch -a)\n\nIt does not create a branch. It creates a ref with slightly funny name (it's\nrefs/heads, not refs/head).\n         ^\n\n>  git push <repo> linus:refs/heads/newbranch\n> creates remote branch newbranch, but you have to know the magic words\n> refs/heads/ to do it.\n\nBecause you could have wanted a tag. Or a remote. Or something completely\ndifferent, maybe because some add-on uses (eg. stgit uses refs/bases and\nrefs/patches, IIRC).\n\n> Se what I mean? \n\nTo me it all looks perfectly consistent. But maybe the documentation should\nstate more clearly, that push works in terms of arbitrary refs, NOT branches.\nFeel free to post a documentation patch (people who just had hard time\nfinding something out are usually better at explaining it than old-timers who\nconsider it obvious).\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"56712","messageId":"003601c81340$0277f5f0$5267a8c0@Jocke","threadId":"10360","inReplyTo":"20071019002451.GQ14735@spearce.org","subject":"RE: git push bug?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-20T17:38:21Z","receivedAt":"2007-10-20T17:38:21Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":" \n\n> -----Original Message-----\n> From: spearce@spearce.org [mailto:spearce@spearce.org] \n> Sent: den 19 oktober 2007 02:25\n> To: Steffen Prohaska\n> Cc: joakim.tjernlund@transmode.se; git\n> Subject: Re: git push bug?\n> \n> Steffen Prohaska <prohaska@zib.de> wrote:\n> > On Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote:\n> > >\n> > ># > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus\n> ...\n> > >error: refusing to create funny ref 'refs/linus' locally\n> > >ng refs/linus funny refname\n> > >error: failed to push to 'ssh://devsrv/var/git/os2kernel.git'\n> ...\n> > You may need to cleanup though. I'm not sure if the remote side\n> > already created 'refs/linus'. The error message only indicates that\n> > locally git refused to create the \"funny refname\".\n> \n> Cute.  The error message \"error: refusing to create .. locally\"\n> is actually coming from the remote site.  Locally here is\n> actually remotely.  We *really* should change that.  Its l.169 of\n> receive-pack.c, which is only running on the remote side.  :)\n> \n> Anyone game to improve that error message?  Should be a pretty\n> simple patch.  One of the may low-hanging fruits in Git.\n\nJust gave it a try, using git sendmail. Hopefully it will\nreach the list :)\n"}]}