Re: [PATCH] cg-pull to stop treating "master" specially, fix fetch_local for .git/HEAD
- From
- Pavel Roskin <proski@gnu.org>
- Date
- Nov 11, 2005, 04:53 UTC
- Message-ID
- <1131684784.31172.16.camel@dv>
- In-Reply-To
- <200511110213.54846.Josef.Weidendorfer@gmx.de>
On Fri, 2005-11-11 at 02:13 +0100, Josef Weidendorfer wrote:
Show 7 quoted lines
> > Correct. But if it's a concern, I think we could make some > > improvements. Following approaches could be tried (starting from top, > > using following steps as a fallback): > > > > 1) Use recorded branch, i.e. the branch name that was used in cg-clone. > > This is the "#..." part in .git/branches/origin, and it is already used.
I'm not sure if we understand each other, but "recorded" refers to automatically determined branch name. If cg-clone can determine the branch name, that name should be saved and used for updates.
Whether the branch name is saved in .git/branches/ using hash notation (old style) or in .git/remotes/ (new style) is irrelevant.
If cg-clone cannot determine the branch name, we may either support it, or revert to "master". I'm ambivalent about that. Probably reverting to "master" is better to simplify the code. On the other hand, I can imagine public repositories without the "master" branch.
> I have nothing against using HEAD for cloning, but the branch name should > be recorded, such that cg-pull always fetches from the same branch.
To use HEAD, we'll need to port git from Cygwin, since readlink doesn't work over http.
> I think 1) is enough if we add the detected branch name in the #... part > in .git/branches/origin at cg-clone time.
I agree that the branch name should be saved explicitly using already supported notation (if that's what you mean).
Show 9 quoted lines
> And "detectable" covers the local case, which was my concern here [*1*] > > Josef > > [*1*] after being told about the "stable HEAD" property of public repositories, > which is correct. I am not even sure that a HEAD makes sense > in public repositories: in my opinion HEAD has something to do with checked out > files, and a public repository usually does not have these. But perhaps > that's only me...
That's why I mentioned the idea of having a separate file to indicate the default branch for export.
-- Regards, Pavel Roskin