Refs naming after clone (was: Re: How to create and keep up to date a naked/bare repository?)
- From
- Josef 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