git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git push bug?

From
Steffen Prohaska <prohaska@zib.de>
Date
Oct 20, 2007, 08:38 UTC
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:
Show 30 quoted lines
>
> 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
Previous: Steffen ProhaskaNext: Joakim Tjernlund
Message 18 of 21 in “git push bug?”
  1. Joakim TjernlundOct 18, 2007
  2. Steffen ProhaskaOct 18, 2007
  3. Joakim TjernlundOct 18, 2007
  4. Joakim TjernlundOct 18, 2007
  5. Shawn O. PearceOct 19, 2007
  6. Steffen ProhaskaOct 18, 2007
  7. Johannes SchindelinOct 18, 2007
  8. Joakim TjernlundOct 18, 2007
  9. Johannes SchindelinOct 18, 2007
  10. Joakim TjernlundOct 19, 2007
  11. Johannes SchindelinOct 19, 2007
  12. Joakim TjernlundOct 19, 2007
  13. Johannes SchindelinOct 19, 2007
  14. Jan HudecOct 20, 2007
  15. Steffen ProhaskaOct 18, 2007
  16. Johannes SchindelinOct 18, 2007
  17. Steffen ProhaskaOct 20, 2007
  18. Steffen ProhaskaOct 20, 2007
  19. Joakim TjernlundOct 20, 2007
  20. Shawn O. PearceOct 19, 2007
  21. Joakim TjernlundOct 20, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.