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

Re: [PATCH] cg-pull to stop treating "master" specially, fix fetch_local for .git/HEAD

From
PRPavel 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
Previous: Josef WeidendorferNext: Josef Weidendorfer
Message 10 of 13 in “cg-pull to stop treating "master" specially, fix fetch_local for .git/HEAD”
  1. cg-pull to stop treating "master" specially, fix fetch_local for .git/HEADPavel Roskin, Aug 23, 2005
  2. Petr BaudisNov 10, 2005
  3. Pavel RoskinNov 10, 2005
  4. Josef WeidendorferNov 10, 2005
  5. Petr BaudisNov 10, 2005
  6. Josef WeidendorferNov 10, 2005
  7. Petr BaudisNov 11, 2005
  8. Pavel RoskinNov 11, 2005
  9. Josef WeidendorferNov 11, 2005
  10. Pavel RoskinNov 11, 2005
  11. Josef WeidendorferNov 11, 2005
  12. Pavel RoskinNov 11, 2005
  13. Josef WeidendorferNov 11, 2005

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.