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, 15:26 UTC
- Message-ID
- <1131722791.1284.20.camel@dv>
- In-Reply-To
- <200511111522.37979.Josef.Weidendorfer@gmx.de>
On Fri, 2005-11-11 at 15:22 +0100, Josef Weidendorfer wrote:
Show 14 quoted lines
> On Friday 11 November 2005 05:53, Pavel Roskin wrote: > > 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. > > Yes. > But for the conrete implementation it is relevant. > > AFAIK, there is not really a "new" and "old" style, but more the > git way (attributes for remote repositories in .git/remotes) and the > Cogito way (attributes for a remote branch).
Switching to the "git way" is long overdue, since hashes can be used in the actual path.
> "Recording" talks about storing the name of the remote branch that > maps to the local "origin" branch, so I would vote for storing this > in .git/branches/origin.
Yes, cg-clone should do its best to determine the branch name and to save it for future use by cg-fetch.
> For cg-clone, this is no problem because cg-clone writes this file itself. > Another thing is if you add later on a remote branch with cg-branch-add > without specifying a concrete remote branch name. Do we want the > record the branch name at the first cg-fetch for the future?
Good that you noticed that.
cg-fetch could do that, but maybe cg-branch-add would be an even better place for that? I mean, cg-branch-add could actually check the repository and prompt the user which branch to use if there is no obvious default. I think, there should be a way to run cg-branch-add without having it connect the repository or prompt the user, but the default should be user-friendly.
-- Regards, Pavel Roskin