{"thread":{"id":"6489","subject":"[PATCH] Allow default core.logallrefupdates to be overridden with template's config","startedAt":"2007-01-23T15:54:27Z","lastAt":"2007-01-24T01:53:33Z","messageCount":8,"participants":["Alex Riesen","Linus Torvalds","Uwe Kleine-König","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"32421","messageId":"81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com","threadId":"6489","inReplyTo":null,"subject":"[PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-01-23T15:54:27Z","receivedAt":"2007-01-23T15:54:27Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Signed-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\nNever found a use for the reflogs and tried to switch\nthem off. Didn't work - init-db rewrote it.\n\n builtin-init-db.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\n\nFrom 713c4890ce795c840f5b4468db8689de44572ef8 Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa.lkml@gmail.com>\nDate: Tue, 23 Jan 2007 16:51:18 +0100\nSubject: [PATCH] Allow default core.logallrefupdates to be overridden with template's config\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n builtin-init-db.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-init-db.c b/builtin-init-db.c\nindex 8e7540b..1865489 100644\n--- a/builtin-init-db.c\n+++ b/builtin-init-db.c\n@@ -257,7 +257,9 @@ static int create_default_files(const char *git_dir, const char *template_path)\n \t}\n \telse {\n \t\tgit_config_set(\"core.bare\", \"false\");\n-\t\tgit_config_set(\"core.logallrefupdates\", \"true\");\n+\t\t/* allow template config file to override the default */\n+\t\tif (log_all_ref_updates == -1)\n+\t\t    git_config_set(\"core.logallrefupdates\", \"true\");\n \t}\n \treturn reinit;\n }\n-- \n1.5.0.rc2.g83d3\n\n"},{"id":"32429","messageId":"Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org","threadId":"6489","inReplyTo":"81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-01-23T16:32:44Z","receivedAt":"2007-01-23T16:32:44Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nAlex,\n just out of curiosity, what _is_ your curious text-attachment thing:\n\n   1 Shown      8 lines  Text (charset: UTF-8)\n   2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)\n\nwhere your normal text is UTF-8, but then attachments are in some really \nstrange encoding name (why not just call it iso-8859-15? Don't ask me..)\n\nAnyway. Strange. \n\n\t\tLinus\n"},{"id":"32436","messageId":"20070123175811.GA8070@cepheus","threadId":"6489","inReplyTo":"Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-01-23T17:58:11Z","receivedAt":"2007-01-23T17:58:11Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi Linus,\n\nLinus Torvalds wrote:\n>  just out of curiosity, what _is_ your curious text-attachment thing:\n> \n>    1 Shown      8 lines  Text (charset: UTF-8)\n>    2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)\nANSI_X3.4-1968 is just the offical name for us-ascii.\n\n\tzeisberg@cepheus:~$ LANG=C locale charmap\n\tANSI_X3.4-1968\n\nI'm not sure that this was making you curious.\n\nAnother strange thing is, that Alex' MUA choosed\n\"Content-Transfer-Encoding: 7bit\" for the first part although UTF-8 is\nan 8bit charset.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=the+speed+of+light+in+m%2Fs\n"},{"id":"32461","messageId":"81b0412b0701231406t5e5808cex31a12b2aa0b6d03e@mail.gmail.com","threadId":"6489","inReplyTo":"Pine.LNX.4.64.0701230827440.32200@woody.linux-foundation.org","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-01-23T22:06:21Z","receivedAt":"2007-01-23T22:06:21Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 1/23/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>  just out of curiosity, what _is_ your curious text-attachment thing:\n>\n>    1 Shown      8 lines  Text (charset: UTF-8)\n>    2   OK    ~928 bytes  Text (charset: ANSI_X3.4-1968)\n>\n> where your normal text is UTF-8, but then attachments are in some really\n> strange encoding name (why not just call it iso-8859-15? Don't ask me..)\n>\n> Anyway. Strange.\n\nThat's Google Mail. The Webmailer. Have no other means to send mail at\nthat time of day.\n"},{"id":"32470","messageId":"7v64axmcmr.fsf@assigned-by-dhcp.cox.net","threadId":"6489","inReplyTo":"81b0412b0701230754p3425ded4k1f37dd26500c1744@mail.gmail.com","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-24T01:34:04Z","receivedAt":"2007-01-24T01:34:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> ---\n>  builtin-init-db.c |    4 +++-\n>  1 files changed, 3 insertions(+), 1 deletions(-)\n> \n> diff --git a/builtin-init-db.c b/builtin-init-db.c\n> index 8e7540b..1865489 100644\n> --- a/builtin-init-db.c\n> +++ b/builtin-init-db.c\n> @@ -257,7 +257,9 @@ static int create_default_files(const char *git_dir, const char *template_path)\n>  \t}\n>  \telse {\n>  \t\tgit_config_set(\"core.bare\", \"false\");\n> -\t\tgit_config_set(\"core.logallrefupdates\", \"true\");\n> +\t\t/* allow template config file to override the default */\n> +\t\tif (log_all_ref_updates == -1)\n> +\t\t    git_config_set(\"core.logallrefupdates\", \"true\");\n>  \t}\n>  \treturn reinit;\n>  }\n\nIt is sensible to let the user say \"I do not want steenking\nreflogs\" (or \"I love reflogs and want one everywhere\").  But I\nthink the above is not really doing that.\n\nWe seem to read ~/.gitconfig while running git-init-db, and I do\nnot think doing so necessarily is a bug.  After all, there may\nbe some configurations you would want to have in ~/.gitconfig to\ncontrol the way git-init-db operates (right now I do not think\nthere is any).\n\nThat makes your new check depend on what is in ~/.gitconfig when\ncore.logallrefupdates is not set (either true or false) in the\ntemplate config.\n\nForgetting the case of having the variable in ~/.gitconfig, what\ndoes it mean to have core.logallrefupdates set in a template\nconfig?  Setting it to true is obvious -- \"I want reflogs\neverywhere\", and I think it happens with or without your patch,\nbecause create_default_files() copies the template.\n\nHowever, when set to false, your check says \"Do not set it\nper-repo\".  This tells git to follow the default \"use reflog in\nnon-bare repositories\" and it does not mean \"I do not want\nsteenking reflogs anywhere\".  So I think at least you would need\nto check for (log_all_ref_updates == 0) and set it explicitly to\n\"false\".\n\nWhile on the topic of config files, we should fix the config\nreader not to allow per-repository variables in ~/.gitconfig\n(issuing warning and ignoring, or erroring out), as some\nvariables such as core.sharedrepository are inherently per\nrepository.  core.repositoryformatversion has the same issue,\nbut we do set it per repository explicitly with init-db, which\nmakes sure that whatever value in ~/.gitconfig is ignored.\n"},{"id":"32474","messageId":"Pine.LNX.4.63.0701240245440.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6489","inReplyTo":"7v64axmcmr.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-24T01:49:17Z","receivedAt":"2007-01-24T01:49:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jan 2007, Junio C Hamano wrote:\n\n> While on the topic of config files, we should fix the config\n> reader not to allow per-repository variables in ~/.gitconfig\n\nSo we finally get this central place where all possible config variables \nare listed, with options (a la struct cmd_struct) which tell more about \nwhere they may be used?\n\nWhile I think this might make sense, I feel quite uneasy about such a \ndrastic change between -rc2 and -final.\n\nCiao,\nDscho\n"},{"id":"32475","messageId":"7v4pqhkx93.fsf@assigned-by-dhcp.cox.net","threadId":"6489","inReplyTo":"Pine.LNX.4.63.0701240245440.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-24T01:51:36Z","receivedAt":"2007-01-24T01:51:36Z","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>> While on the topic of config files, we should fix the config\n>> reader not to allow per-repository variables in ~/.gitconfig\n>\n> So we finally get this central place where all possible config variables \n> are listed, with options (a la struct cmd_struct) which tell more about \n> where they may be used?\n>\n> While I think this might make sense, I feel quite uneasy about such a \n> drastic change between -rc2 and -final.\n\nI do not like the \"config registry\" in 1.5.0 but a simple\nblacklisting should work, shouldn't it?\n"},{"id":"32476","messageId":"7vy7ntjile.fsf@assigned-by-dhcp.cox.net","threadId":"6489","inReplyTo":"7v64axmcmr.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Allow default core.logallrefupdates to be overridden with template's config","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-24T01:53:33Z","receivedAt":"2007-01-24T01:53:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> However, when set to false, your check says \"Do not set it\n> per-repo\".  This tells git to follow the default \"use reflog in\n> non-bare repositories\" and it does not mean \"I do not want\n> steenking reflogs anywhere\".\n\nThis part is not true -- as we copy the templated config which\nhas explicit \"no steenking reflog\" to the new repository.\n\nSo I am Ok with your patch.\n"}]}