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

Re: push.default???

From
Finn Arne Gangstad <finnag@pvv.org>
Date
Jun 24, 2009, 21:59 UTC
Message-ID
<20090624215922.GA13575@pvv.org>
In-Reply-To
<4A41E8B8.8050803@gmail.com>
On Wed, Jun 24, 2009 at 10:50:00AM +0200, Paolo Bonzini wrote:
>
> Here is what I think you are missing: in the proposed workflow, there is  
> an entire group working on one big feature, so there is effectively one  
> remote per feature.

I think you are making this more complicated than it is. I just claim that the idea that "branch names must be identical in both ends" is not necessarily the best model.

In a sufficiently large origanisation with multiple levels of repositories (access restrictions, locality, whatever) branch names are not globally unique, and there is no reasonable way to check if a branch name is used elsewhere. It is much easier to treat local branch names as strictly local, and worry about naming (only) when you push somewhere.

So - even if someone decided to name something "issue-331318" on a public repository, it doesn't mean you want to call it that locally, even if you want to push to it.

If a branch already exists on a public repo, it doesn't mean a branch with the same name but with different contents/purpose cannot exist in a different repo. So you may have to name the branch something else locally. Pull knows how to deal with this, but push did not (before "--tracking").

Another example:

You have worked for a few days on an issue, but need help from someone else with something. You have set up a public shared repo named "public", and do:

git push public HEAD:fred-helpme

Fred wants to name it something else that makes him remember what this branch is about, and does:

git fetch public git checkout -b tmp-help-john public/fred-helpme <hack hack> git commit git push (no more arguments, and no need to remember what it was named)

You then fetch and look at what Fred has done, and maybe you just use it, or maybe you don't. Afterwards git push public :fred-helpme to get rid of the temporary shared branch.

- Finn Arne
Previous: Paolo Bonzini
Message 18 of 18 in “push.default???”
  1. Paolo BonziniJun 22, 2009
  2. Junio C HamanoJun 22, 2009
  3. Paolo BonziniJun 22, 2009
  4. Finn Arne GangstadJun 23, 2009
  5. Paolo BonziniJun 23, 2009
  6. Finn Arne GangstadJun 23, 2009
  7. Andreas EricssonJun 23, 2009
  8. Finn Arne GangstadJun 23, 2009
  9. Andreas EricssonJun 23, 2009
  10. Paolo BonziniJun 23, 2009
  11. Finn Arne GangstadJun 23, 2009
  12. Paolo BonziniJun 23, 2009
  13. Junio C HamanoJun 23, 2009
  14. Junio C HamanoJun 23, 2009
  15. Miles BaderJun 24, 2009
  16. Junio C HamanoJun 24, 2009
  17. Paolo BonziniJun 24, 2009
  18. Finn Arne GangstadJun 24, 2009

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.