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

Re: [RFC 2/2] Automatically transform .git/{branches,remotes} into .git/config

From
Junio C Hamano <junkio@cox.net>
Date
Nov 21, 2005, 22:26 UTC
Message-ID
<7vpsotmych.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0511211653420.2569@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 15 quoted lines
> On Mon, 21 Nov 2005, Josef Weidendorfer wrote:
>
>> On Monday 21 November 2005 14:56, Johannes Schindelin wrote:
>> > With this patch, git automatically extracts the information from 
>> > .git/branches and .git/remotes, puts it into .git/config, and renames the 
>> > directories to .git/branches.old and .git/remotes.old, respectively.
>> 
>> Please... don't trash .git/branches.
>> This is about Cogito, not about Git. You will render every repository cloned
>> with Cogito useless, as it expects a per-branch configuration with the same
>> name as heads.
>> 
> I was aware that .git/branches was introduced by Pasky, but as it is 
> handled in git-parse-remote.sh, I thought that it may be a bit more 
> general than just cogito.

What Josef said is correct in that I was not aware of the fact that Cogito branches/ are *per-branch* configuration when I did parse-remote. remotes/ are deliberately *per-remote* configuration, because it is more efficient when you are downloading more than one refs from the same remote over a git-aware protocol. Arguably, it is optimizing for the wrong case, because it may well be a minority case to keep track of more than one remote head. I dunno.

I am not sure if it is a good idea to automatically convert what is stored in .git/branches to .git/remotes (or the equivalent of the latter in .git/config), but if somebody wanted to do it, the right thing would be:

 - grab the URL without optional fragment '#rembranch' part from
   all branches/* file;
 - group the ones that fetch from the same URL into one
   remotes/$file (what to call that file is very debatable
   because the original branches/* is in different namespace and
   we cannot tell what the user wants to call the remote),
   giving appropriate head mapping.  branches/$branch file with
   the fragment part '#$rembranch' translates to "Pull:
   $rembranch:$branch".
Previous: Andreas EricssonNext: Petr Baudis
Message 6 of 21 in “[RFC 2/2] Automatically transform .git/{branches,remotes} into .git/config”
  1. Johannes SchindelinNov 21, 2005
  2. Josef WeidendorferNov 21, 2005
  3. Johannes SchindelinNov 21, 2005
  4. Josef WeidendorferNov 21, 2005
  5. Andreas EricssonNov 21, 2005
  6. Junio C HamanoNov 21, 2005
  7. Petr BaudisNov 27, 2005
  8. Johannes SchindelinNov 28, 2005
  9. Junio C HamanoNov 28, 2005
  10. Andreas EricssonNov 28, 2005
  11. Junio C HamanoNov 28, 2005
  12. Josef WeidendorferNov 28, 2005
  13. Andreas EricssonNov 28, 2005
  14. Generic configuration plumbing (Was: Re: [RFC 2/2] Automatically transform...)Josef Weidendorfer, Nov 28, 2005
  15. Johannes SchindelinNov 28, 2005
  16. Petr BaudisNov 28, 2005
  17. Josef WeidendorferNov 28, 2005
  18. Junio C HamanoNov 29, 2005
  19. Johannes SchindelinNov 28, 2005
  20. Petr BaudisNov 28, 2005
  21. Johannes SchindelinNov 28, 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.