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
Petr Baudis <pasky@suse.cz>
Date
Nov 7, 2005, 23:21 UTC
Message-ID
<20051107232122.GZ1431@pasky.or.cz>
In-Reply-To
<7v8xw216q9.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Sun, Nov 06, 2005 at 10:11:10AM CET, I got a letter where Junio C Hamano <junkio@cox.net> told me that...

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

The problem is that at least Cogito defaults to the 'origin' branch when pulling/merging, so if you'll have 'origin/master' instead of 'origin', I will have to hack that around. So it's not _just_ a convention but something reflected in some code as well.

Show 5 quoted lines
>  - 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".

This loses the pretty nice property that 'origin' refers to the HEAD branch of the remote repository, no matter how is it called (well, it is nice as long as the remote repository doesn't _switch_ the HEAD to some non-superset branch; but repositories you're cloning from shouldn't do that). So you should either have origin/HEAD locally, or make the 'master' branch more "socially canonical".

> *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.
What would it be useful for?
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.