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, 00:14 UTC
Message-ID
<1131668075.3987.5.camel@dv>
In-Reply-To
<20051110234029.GE30496@pasky.or.cz>
On Fri, 2005-11-11 at 00:40 +0100, Petr Baudis wrote: 
Show 9 quoted lines
> Dear diary, on Fri, Nov 11, 2005 at 12:26:18AM CET, I got a letter
> where Josef Weidendorfer <Josef.Weidendorfer@gmx.de> said that...
> > Why would anybody want to fetch the current upstream HEAD at cg-pull
> > time? If you do this, and you have no control on the upstream
> > repository, "origin" will jump randomly around after cg-pull, depending
> > on the current HEAD of the origin repository.
> 
> In public repositories, you usually set the HEAD once and it stays
> there, or when you switch it, you are really careful about it.

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.
2) Check a file specifying the default branch for cloning (let's call it
e.g. .git/default_export).  Record branch name.
3) If cg-switch is implemented, another file would be likely used to
specify the default branch for local operations
(e.g. .git/default_branch).  Use it.  Record branch name.
4) If .git/HEAD can be recognized as link (we may need to eliminate
symlinks for that to work over remote transport), use the branch it
points to.  Record branch name.
5) If .git/HEAD cannot be recognized as link, use it as the branch to
clone.  Don't record the branch name.  (I'm not sure if we really want
that - it's good to know what branch we are using).
6) Use "master" branch.  Record branch name.
-- 
Regards,
Pavel Roskin
Previous: Petr BaudisNext: Josef Weidendorfer
Message 8 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.