{"thread":{"id":"22831","subject":"[PATCH] Having keywords without value is not a global error.","startedAt":"2010-02-26T04:00:20Z","lastAt":"2010-02-26T08:35:39Z","messageCount":7,"participants":["Steven Drake","Junio C Hamano","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135725","messageId":"c28821e9079f35e7267a1e7381ccf7793c12bf24.1267156694.git.sdrake@xnet.co.nz","threadId":"22831","inReplyTo":null,"subject":"[PATCH] Having keywords without value is not a global error.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T04:00:20Z","receivedAt":"2010-02-26T04:00:20Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"It is not a good Idea to give a config_error for _any_ keyword without a\nvalue as it means that\n\n\t[section]\n\t\tkeyword\n\nsytle can not be using for setting bool type keyword.\n\nSigned-off-by: Steven Drake <sdrake@xnet.co.nz>\n---\n builtin/init-db.c |    2 --\n 1 files changed, 0 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 9273942..edc40ff 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -170,8 +170,6 @@ static void copy_templates(const char *template_dir)\n \n static int git_init_db_config(const char *k, const char *v, void *cb)\n {\n-\tif (!v)\n-\t\treturn config_error_nonbool(k);\n \tif (!strcmp(k, \"init.templatedir\"))\n \t\treturn git_config_pathname(&init_db_template_dir, k, v);\n \n-- \n1.6.6\n"},{"id":"135726","messageId":"7bce5804fd71ac19c9164c9c2deb9dd714dc7aee.1267156694.git.sdrake@xnet.co.nz","threadId":"22831","inReplyTo":"c28821e9079f35e7267a1e7381ccf7793c12bf24.1267156694.git.sdrake@xnet.co.nz","subject":"[PATCH] t/t0001-init.sh: add test for 'init with init.templatedir set'","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T04:00:21Z","receivedAt":"2010-02-26T04:00:21Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"Requires a small change to wrap-for-bin.sh in order to work.\n\nSigned-off-by: Steven Drake <sdrake@xnet.co.nz>\n---\n t/t0001-init.sh |   19 +++++++++++++++++++\n wrap-for-bin.sh |    3 ++-\n 2 files changed, 21 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 5386504..6757734 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -167,6 +167,25 @@ test_expect_success 'init with --template (blank)' '\n \t! test -f template-blank/.git/info/exclude\n '\n \n+test_expect_success 'init with init.templatedir set' '\n+\tmkdir templatedir-source &&\n+\techo Content >templatedir-source/file &&\n+\t(\n+\t\tHOME=\"`pwd`\" &&\n+\t\texport HOME &&\n+\t\ttest_config=\"${HOME}/.gitconfig\" &&\n+\t\tgit config -f \"$test_config\"  init.templatedir \"${HOME}/templatedir-source\" &&\n+\t\tmkdir templatedir-set &&\n+\t\tcd templatedir-set &&\n+\t\tunset GIT_CONFIG_NOGLOBAL &&\n+\t\tunset GIT_TEMPLATE_DIR &&\n+\t\tNO_SET_GIT_TEMPLATE_DIR=t &&\n+\t\texport NO_SET_GIT_TEMPLATE_DIR &&\n+\t\tgit init\n+\t) &&\n+\ttest_cmp templatedir-source/file templatedir-set/.git/file\n+'\n+\n test_expect_success 'init --bare/--shared overrides system/global config' '\n \t(\n \t\tHOME=\"`pwd`\" &&\ndiff --git a/wrap-for-bin.sh b/wrap-for-bin.sh\nindex c5075c9..aece782 100644\n--- a/wrap-for-bin.sh\n+++ b/wrap-for-bin.sh\n@@ -7,7 +7,8 @@\n # @@BUILD_DIR@@ and @@PROG@@.\n \n GIT_EXEC_PATH='@@BUILD_DIR@@'\n-GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'\n+test -z \"$NO_SET_GIT_TEMPLATE_DIR\" &&\n+\tGIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'\n GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'\n PATH='@@BUILD_DIR@@/bin-wrappers:'\"$PATH\"\n export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH\n-- \n1.6.6\n"},{"id":"135731","messageId":"7vk4u0efxy.fsf@alter.siamese.dyndns.org","threadId":"22831","inReplyTo":"c28821e9079f35e7267a1e7381ccf7793c12bf24.1267156694.git.sdrake@xnet.co.nz","subject":"Re: [PATCH] Having keywords without value is not a global error.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-26T05:14:49Z","receivedAt":"2010-02-26T05:14:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Drake <sdrake@xnet.co.nz> writes:\n\n> It is not a good Idea to give a config_error for _any_ keyword without a\n> value as it means that\n>\n> \t[section]\n> \t\tkeyword\n>\n> sytle can not be using for setting bool type keyword.\n>\n> Signed-off-by: Steven Drake <sdrake@xnet.co.nz>\n> ---\n>  builtin/init-db.c |    2 --\n>  1 files changed, 0 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/init-db.c b/builtin/init-db.c\n> index 9273942..edc40ff 100644\n> --- a/builtin/init-db.c\n> +++ b/builtin/init-db.c\n> @@ -170,8 +170,6 @@ static void copy_templates(const char *template_dir)\n>  \n>  static int git_init_db_config(const char *k, const char *v, void *cb)\n>  {\n> -\tif (!v)\n> -\t\treturn config_error_nonbool(k);\n>  \tif (!strcmp(k, \"init.templatedir\"))\n>  \t\treturn git_config_pathname(&init_db_template_dir, k, v);\n\nBut then don't you need to catch init.templatedir does have a string\nvalue?\n\n>  \n> -- \n> 1.6.6\n"},{"id":"135733","messageId":"alpine.LNX.2.00.1002261838360.8597@vqena.qenxr.bet.am","threadId":"22831","inReplyTo":"7vk4u0efxy.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Having keywords without value is not a global error.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T05:44:31Z","receivedAt":"2010-02-26T05:44:31Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"On Thu, 25 Feb 2010, Junio C Hamano wrote:\n> Steven Drake <sdrake@xnet.co.nz> writes:\n> \n> > It is not a good Idea to give a config_error for _any_ keyword without a\n> > value as it means that\n> >\n> > \t[section]\n> > \t\tkeyword\n> >\n> > sytle can not be using for setting bool type keyword.\n> >\n> > Signed-off-by: Steven Drake <sdrake@xnet.co.nz>\n> > ---\n> >  builtin/init-db.c |    2 --\n> >  1 files changed, 0 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/builtin/init-db.c b/builtin/init-db.c\n> > index 9273942..edc40ff 100644\n> > --- a/builtin/init-db.c\n> > +++ b/builtin/init-db.c\n> > @@ -170,8 +170,6 @@ static void copy_templates(const char *template_dir)\n> >  \n> >  static int git_init_db_config(const char *k, const char *v, void *cb)\n> >  {\n> > -\tif (!v)\n> > -\t\treturn config_error_nonbool(k);\n> >  \tif (!strcmp(k, \"init.templatedir\"))\n> >  \t\treturn git_config_pathname(&init_db_template_dir, k, v);\n> \n> But then don't you need to catch init.templatedir does have a string\n> value?\n\nYes, but the change dose not touch that test, it removes two lines that I\ncan't remember why a put there.\n\n-- \nSteven\n"},{"id":"135734","messageId":"7vljegczes.fsf@alter.siamese.dyndns.org","threadId":"22831","inReplyTo":"alpine.LNX.2.00.1002261838360.8597@vqena.qenxr.bet.am","subject":"Re: [PATCH] Having keywords without value is not a global error.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-26T05:57:15Z","receivedAt":"2010-02-26T05:57:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Steven Drake <sdrake@xnet.co.nz> writes:\n\n>> >  \tif (!strcmp(k, \"init.templatedir\"))\n>> >  \t\treturn git_config_pathname(&init_db_template_dir, k, v);\n>> \n>> But then don't you need to catch init.templatedir does have a string\n>> value?\n>\n> Yes, but the change dose not touch that test,...\n\nAhh, config_pathname() does its own check for NULLness, Ok, I forgot.\n\nThanks.\n"},{"id":"135738","messageId":"81b0412b1002260019r3d5268f2x4b48051409e0c8f5@mail.gmail.com","threadId":"22831","inReplyTo":"c28821e9079f35e7267a1e7381ccf7793c12bf24.1267156694.git.sdrake@xnet.co.nz","subject":"Re: [PATCH] Having keywords without value is not a global error.","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-02-26T08:19:28Z","receivedAt":"2010-02-26T08:19:28Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Fri, Feb 26, 2010 at 05:00, Steven Drake <sdrake@xnet.co.nz> wrote:\n> It is not a good Idea to give a config_error for _any_ keyword without a\n> value as it means that\n>\n>        [section]\n>                keyword\n>\n> sytle can not be using for setting bool type keyword.\n\nTypo: sytle (style?)\n"},{"id":"135739","messageId":"alpine.LNX.2.00.1002262135150.8908@vqena.qenxr.bet.am","threadId":"22831","inReplyTo":"81b0412b1002260019r3d5268f2x4b48051409e0c8f5@mail.gmail.com","subject":"Re: [PATCH] Having keywords without value is not a global error.","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-02-26T08:35:39Z","receivedAt":"2010-02-26T08:35:39Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"On Fri, 26 Feb 2010, Alex Riesen wrote:\n\n> On Fri, Feb 26, 2010 at 05:00, Steven Drake <sdrake@xnet.co.nz> wrote:\n> > It is not a good Idea to give a config_error for _any_ keyword without a\n> > value as it means that\n> >\n> >        [section]\n> >                keyword\n> >\n> > sytle can not be using for setting bool type keyword.\n> \n> Typo: sytle (style?)\n\nYes!!! \n\n-- \nSteven"}]}