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

Refs naming after clone (was: Re: How to create and keep up to date a naked/bare repository?)

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Jan 27, 2006, 10:30 UTC
Message-ID
<200601271130.50322.Josef.Weidendorfer@gmx.de>
In-Reply-To
<7vd5ie735a.fsf@assigned-by-dhcp.cox.net>
Hi,
On Friday 27 January 2006 04:36, Junio wrote:
> The latest git-clone.sh stopped creating both refs/heads/origin
> and remotes/origin.  The former was to prevent common mistake
> when using it as a shared repository, but removal of the latter
> might have been a mistake.  I dunno.
IMHO it is convenient if git-clone remembers the origin repository
in any case.
 
> Let's step back a bit and think about the modes of usage for a
> bare cloned repository.

It would be nice to have a default which is working nice in all cases (not only bare ones as discussed here).

IMHO the main problem with the current default (creating master and origin heads after cloning) is that two namespaces are mixed up: (1) local (possible development) heads (2) and heads tracking remote heads

Any compatibility issues aside, wouldn't it be better to have another namespace for (2), similar to the proposed ref namespaces for subprojects, like refs/remote/<remote-shortcut>/heads/<remote-head> ? Clone would create a head refs/remote/origin/heads/master to track the master of the origin remote repo.

In the case of a the mirror discussed here, you would default to quite cumbersome long head names: Tracking master of git://git.kernel.org/pub/scm/git/git.git in the central mirroring repository would be done on "remote/origin/heads/master", and tracking this mirror head in developer repos would give a head name "remote/origin/remote/origin/heads/master".

Still, I think this is nice because everybody can see that above head is tracking a remote head which is tracking itself another remote head. gitk could give remote tracking heads another color.

Note that I talk only about the default setup, which of course can be changed by changing .git/remotes/origin. Eg. in the mirror case, you probably want local and remote namespace being the same, ie. .git/refs/heads/* -> .git/refs/remote/origin/heads/*

Perhaps a command to rename head names, which automatically updates pull/push lines of .git/remotes/ accordingly would be nice here. Also a command to rename remote shortcuts (e.g. origin to gitmain), renaming above proposed head names accordingly would be nice.

Josef
Previous: Junio C HamanoNext: Mathieu Chouquet-Stringer
Message 9 of 14 in “[RFD] remembering hand resolve...”
  1. Junio C HamanoJan 25, 2006
  2. Andreas EricssonJan 25, 2006
  3. Junio C HamanoJan 25, 2006
  4. How to create and keep up to date a naked/bare repository?Mathieu Chouquet-Stringer, Jan 26, 2006
  5. Junio C HamanoJan 26, 2006
  6. Mathieu Chouquet-StringerJan 26, 2006
  7. Mathieu Chouquet-StringerJan 26, 2006
  8. Junio C HamanoJan 27, 2006
  9. Refs naming after clone (was: Re: How to create and keep up to date a naked/bare repository?)Josef Weidendorfer, Jan 27, 2006
  10. Mathieu Chouquet-StringerJan 27, 2006
  11. Junio C HamanoJan 27, 2006
  12. J. Bruce FieldsJan 27, 2006
  13. Junio C HamanoJan 27, 2006
  14. git-rerere: reuse recorded resolve.Junio C Hamano, Jan 29, 2006

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.