{"thread":{"id":"2535","subject":"[PATCH 0/3] Support setting SymrefsOnly=true from scripts","startedAt":"2005-11-15T21:36:05Z","lastAt":"2005-11-17T19:29:58Z","messageCount":6,"participants":["Johannes Schindelin","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"11935","messageId":"Pine.LNX.4.63.0511152233430.2152@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2535","inReplyTo":null,"subject":"[PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-15T21:36:05Z","receivedAt":"2005-11-15T21:36:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nthis series of patches does three things:\n\n\t- support for setting config variables\n\t- ditto, but from scripts\n\t- set SymrefsOnly=true right from the start with\n\n\t\tgit-init-db --dont-use-symrefs\n\nCiao,\nDscho\n"},{"id":"11951","messageId":"7vfypxh5mn.fsf@assigned-by-dhcp.cox.net","threadId":"2535","inReplyTo":"Pine.LNX.4.63.0511152233430.2152@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-15T23:07:44Z","receivedAt":"2005-11-15T23:07:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> \t- set SymrefsOnly=true right from the start with\n> \t\tgit-init-db --dont-use-symrefs\n\nI am almost tempted to say that we should be doing --template=\noption to git-init-db for something like this, and make the\ntemplate instantiation first thing before even reading the\nconfig file.\n\nThe rest might be useful to better support end-users, but I am\nnot sure.  Is it that much hassle to them to edit an .ini file?\n"},{"id":"11972","messageId":"Pine.LNX.4.63.0511160127130.4334@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2535","inReplyTo":"7vfypxh5mn.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-16T00:49:27Z","receivedAt":"2005-11-16T00:49:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 15 Nov 2005, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > \t- set SymrefsOnly=true right from the start with\n> > \t\tgit-init-db --dont-use-symrefs\n> \n> I am almost tempted to say that we should be doing --template=\n> option to git-init-db for something like this, and make the\n> template instantiation first thing before even reading the\n> config file.\n\nWell, problem is that if you use templates to install a .git/config, the \ncode in init-db which checks for safe filemode no longer gets called. And \nwe don't know yet what else we might want to write into the config from \ninit-db, or from anywhere else for that matter.\n\nFurthermore: if you have a nice template which says that SymrefsOnly=true, \ninit-db will still create HEAD as a symlink! (Note that my patch sets \nthe *global* only_use_symrefs from the command line option, not a \nlocal variable!)\n\nSo, if you want a repository to explicitely force symrefs, you have to \nhave special handling in init-db. And for consistency, you should \nmodify/write the config file to include \"SymrefsOnly=true\" right away.\n\nAlternatively, or in addition to my patch, you could do a git_config() \njust after copy_templates() (you allude to this, but note that init-db \ndoes not read the config at any stage yet).\n\nHowever! This only works if you are sure that the templates you need are \ninstalled. I *never* install git, but *always* have my private working \ndirectory in the PATH. So, I never have templates installed. Neither do I \nplan to.\n\n> The rest might be useful to better support end-users, but I am\n> not sure.  Is it that much hassle to them to edit an .ini file?\n\nObviously, I'd prefer to have at least the patch adding git_config_set() \napplied. This is core plumbing. It actually checks if the name is valid, \nand it automatically escapes the value when needed. Before doing anything, \nit checks that the config file is valid. It does locking. It creates a \nsimple config if none was there yet. And it's small.\n\nAs for git-config-set, I guess it would be rather handy for Porcelains \n(and t/blabla-config.sh), but I could be convinced otherwise.\n\nCiao,\nDscho\n"},{"id":"11974","messageId":"7v8xvpe6vi.fsf@assigned-by-dhcp.cox.net","threadId":"2535","inReplyTo":"Pine.LNX.4.63.0511160127130.4334@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-16T01:09:05Z","receivedAt":"2005-11-16T01:09:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Tue, 15 Nov 2005, Junio C Hamano wrote:\n>\n>> I am almost tempted to say that we should be doing --template=\n>> option to git-init-db for something like this, and make the\n>> template instantiation first thing before even reading the\n>> config file.\n>\n> Well, problem is that if you use templates to install a .git/config, the \n> code in init-db which checks for safe filemode no longer gets called. And \n> we don't know yet what else we might want to write into the config from \n> init-db, or from anywhere else for that matter.\n>\n> Furthermore: if you have a nice template which says that SymrefsOnly=true, \n> init-db will still create HEAD as a symlink!\n\nFunny.  These two are what I meant by \"make the template\ninstantiation first thing\".  So instead of the hardcoded\nonly_symbolic_ref assignment and filemode check code, can't we\ndo something like this?\n\n - copy the template; if the commandline specifies where the\n   templates are, take them from there otherwise use the\n   built-in location.\n\n - read from config; note if you actually read any (may not have\n   config in your template suite, or you might not have\n   templates at all).\n\n - do filemode check, and maybe git_config_set() there and write\n   the result back as the new config for that repository.\n\n - create the rest, including the HEAD ref.\n\nThe user could even have more than one template set (one for\nVFAT and another for non VFAT).  Once we go that route, we may\nnot even need the special filemode check code in init-db.  No?\n"},{"id":"12117","messageId":"20051117120909.GA30496@pasky.or.cz","threadId":"2535","inReplyTo":"7v8xvpe6vi.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-17T12:09:09Z","receivedAt":"2005-11-17T12:09:09Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Nov 16, 2005 at 02:09:05AM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n>  - copy the template; if the commandline specifies where the\n>    templates are, take them from there otherwise use the\n>    built-in location.\n\nThe disadvantage is that I will have to maintain my own template for\nCogito, which is silly - I would much rather just use GIT's default\ntemplates and only add the symrefonly option on behalf of Cogito.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"12131","messageId":"7vpsozt6mh.fsf@assigned-by-dhcp.cox.net","threadId":"2535","inReplyTo":"20051117120909.GA30496@pasky.or.cz","subject":"Re: [PATCH 0/3] Support setting SymrefsOnly=true from scripts","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-17T19:29:58Z","receivedAt":"2005-11-17T19:29:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> The disadvantage is that I will have to maintain my own template for\n> Cogito, which is silly - I would much rather just use GIT's default\n> templates and only add the symrefonly option on behalf of Cogito.\n\nThat's very true.  However I suspect Cogito users are expected\nto run cg-admin-init not git-init-db, so admin-init can do\nwhatever postprocessing necessary after calling init-db?  That\nway would let you do more than what template would, I presume.\n"}]}