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

Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts

From
Junio C Hamano <junkio@cox.net>
Date
Nov 16, 2005, 01:09 UTC
Message-ID
<7v8xvpe6vi.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0511160127130.4334@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 14 quoted lines
> On Tue, 15 Nov 2005, Junio C Hamano wrote:
>
>> I am almost tempted to say that we should be doing --template=
>> option to git-init-db for something like this, and make the
>> template instantiation first thing before even reading the
>> config file.
>
> Well, problem is that if you use templates to install a .git/config, the 
> code in init-db which checks for safe filemode no longer gets called. And 
> we don't know yet what else we might want to write into the config from 
> init-db, or from anywhere else for that matter.
>
> Furthermore: if you have a nice template which says that SymrefsOnly=true, 
> init-db will still create HEAD as a symlink!

Funny. These two are what I meant by "make the template instantiation first thing". So instead of the hardcoded only_symbolic_ref assignment and filemode check code, can't we do something like this?

 - copy the template; if the commandline specifies where the
   templates are, take them from there otherwise use the
   built-in location.
 - read from config; note if you actually read any (may not have
   config in your template suite, or you might not have
   templates at all).
 - do filemode check, and maybe git_config_set() there and write
   the result back as the new config for that repository.
 - create the rest, including the HEAD ref.

The user could even have more than one template set (one for VFAT and another for non VFAT). Once we go that route, we may not even need the special filemode check code in init-db. No?

Previous: Johannes SchindelinNext: Petr Baudis
Message 4 of 6 in “Support setting SymrefsOnly=true from scripts”
  1. 0/3 Support setting SymrefsOnly=true from scriptsJohannes Schindelin, Nov 15, 2005
  2. Junio C HamanoNov 15, 2005
  3. Johannes SchindelinNov 16, 2005
  4. Junio C HamanoNov 16, 2005
  5. Petr BaudisNov 17, 2005
  6. Junio C HamanoNov 17, 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.