From: Steffen Prohaska Date: Sat, 20 Oct 2007 08:38:04 GMT Subject: Re: git push bug? Message-ID: <1216340A-9A44-49AC-9FF6-B289E8736893@zib.de> In-Reply-To: <5513C211-DE33-411C-8EE6-2259B41DC3EA@zib.de> Shawn, sp/push-refspec definitely needs more work (see below). On Oct 20, 2007, at 10:29 AM, Steffen Prohaska wrote: > > On Oct 18, 2007, at 11:58 PM, Johannes Schindelin wrote: > >> >> On Thu, 18 Oct 2007, Steffen Prohaska wrote: >>> >>> 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: > > [...] > > 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. And I even fixed the behavior to match my expectation in a patch which made it to spearce/pu: d869233c62688742968663c4e8b5ff20a50a5011 push, send-pack: fix test if remote branch exists for colon-less refspec A push must fail if the remote ref does not yet exist and the refspec does not start with refs/. Remote refs must explicitly be created with their full name. This commit adds some tests and fixes the existence check in send-pack. sp/push-refspec definitely needs some more work. Steffen