Re: [PATCH] Cogito: Support for implicit remote branches in cloned repositories
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Nov 4, 2005, 22:07 UTC
- Message-ID
- <Pine.LNX.4.64.0511041359050.28804@g5.osdl.org>
- In-Reply-To
- <7voe50rskh.fsf@assigned-by-dhcp.cox.net>
On Fri, 4 Nov 2005, Junio C Hamano wrote:
> > I agree with you violently. I just do not know what is the > right convention to tell which is private and which is not.
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.
That avoids the issue of the remote repo _also_ having an "origin" branch.
Locally, the "local" heads would always take precedence, with this trivial patch making sure of that..
If you want to access a global tag or head, you can always do so by using the full path ("refs/tags/tagname" is the global one, but "tags/tagname" or "tagname" would be the local one if one exists).
Linus
---
diff --git a/sha1_name.c b/sha1_name.c index be1755a..5daaa11 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -231,6 +231,8 @@ static int get_sha1_basic(const char *st static const char *prefix[] = { "", "refs", + "refs/local/tags", + "refs/local/heads", "refs/tags", "refs/heads", NULL