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

Re: [PATCH] Cogito: Support for implicit remote branches in cloned repositories

From
Junio C Hamano <junkio@cox.net>
Date
Nov 6, 2005, 09:11 UTC
Message-ID
<7v8xw216q9.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0511041359050.28804@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 12 quoted lines
> I don't like the dot idea, but it certainly _would_ make sense to have a 
> local prefix.
>
> We could even make it a _totally_ different namespace:
>
> 	.git/refs/local/heads
> 	.git/refs/local/tags
>
> which means that even if you call a local head the same thing as a global 
> one, both can still exist.
>
> Then, make "origin" always be a local head.

While that is logically the right thing to do, it is somewhat confusing to see all those branch heads we obtained from the remote side stored as our "local" branches -- meaning they are private to us.

Just for discussion, I'd suggest a less structured approach as an alternative, and making it just a convention.

 - clone by default [*1*] creates .git/refs/heads/origin/*
   heads; your "master" becomes my "origin/master".
   Interestingly but logically, if your repository was cloned
   from somewhere else, you would have "origin/master", which
   would become my "origin/origin/master".
 - clone creates remotes/origin that knows all branches from the
   origin as copied by the above process, as suggested by Daniel
   in the other thread.

Then we would have a recommended workflow example that uses origin/* as reference branches after they are set up. After becoming familiar with this setup, when people fetch/pull from more than one repository, they can configure things correctly by emulating what clone did to the "origin" remote repository for them.

[Footnote]

*1* I say "by default" here; I think there should be an operating mode for git clone that acts as a straight copy, not even the current "HEAD" -> "origin" renaming. In fact that is what you do with low-level git-clone-pack.

Previous: Linus TorvaldsNext: Petr Baudis
Message 7 of 10 in “Cogito: Support for implicit remote branches in cloned repositories”
  1. Cogito: Support for implicit remote branches in cloned repositoriesJosef Weidendorfer, Nov 4, 2005
  2. Junio C HamanoNov 4, 2005
  3. Josef WeidendorferNov 4, 2005
  4. Petr BaudisNov 4, 2005
  5. Junio C HamanoNov 4, 2005
  6. Linus TorvaldsNov 4, 2005
  7. Junio C HamanoNov 6, 2005
  8. Petr BaudisNov 7, 2005
  9. Junio C HamanoNov 7, 2005
  10. Josef WeidendorferNov 8, 2005

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.