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

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:12

Johannes Schindelin [off-list ref] writes:
On Tue, 15 Nov 2005, Junio C Hamano wrote:
quoted
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?

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

From: Petr Baudis <hidden>
Date: 2016-06-15 22:42:12

Dear diary, on Wed, Nov 16, 2005 at 02:09:05AM CET, I got a letter
where Junio C Hamano [off-list ref] said that...
 - copy the template; if the commandline specifies where the
   templates are, take them from there otherwise use the
   built-in location.
The disadvantage is that I will have to maintain my own template for
Cogito, which is silly - I would much rather just use GIT's default
templates and only add the symrefonly option on behalf of Cogito.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:12

Petr Baudis [off-list ref] writes:
The disadvantage is that I will have to maintain my own template for
Cogito, which is silly - I would much rather just use GIT's default
templates and only add the symrefonly option on behalf of Cogito.
That's very true.  However I suspect Cogito users are expected
to run cg-admin-init not git-init-db, so admin-init can do
whatever postprocessing necessary after calling init-db?  That
way would let you do more than what template would, I presume.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help