{"thread":{"id":"27771","subject":"[RFC/PATCH] Changed gitweb.remote_heads config key name to gitweb.remoteHeads.","startedAt":"2011-07-07T18:02:19Z","lastAt":"2011-07-07T20:36:50Z","messageCount":3,"participants":["Marc Branchaud","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"170979","messageId":"1310061739-4441-1-git-send-email-marcnarc@xiplink.com","threadId":"27771","inReplyTo":null,"subject":"[RFC/PATCH] Changed gitweb.remote_heads config key name to gitweb.remoteHeads.","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2011-07-07T18:02:19Z","receivedAt":"2011-07-07T18:02:19Z","isPatch":true,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Git doesn't accept config key names with underscore characters.\n\nSigned-off-by: Marc Branchaud <marcnarc@xiplink.com>\n---\n\nCame across this today.  The patch is RFC because I have not verified \nif it's complete or if gitweb even respects the setting.\n\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 81dacf2..edbb080 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -524,9 +524,9 @@ our %feature = (\n \t# $feature{'remote_heads'}{'default'} = [1];\n \t# To have project specific config enable override in $GITWEB_CONFIG\n \t# $feature{'remote_heads'}{'override'} = 1;\n-\t# and in project config gitweb.remote_heads = 0|1;\n+\t# and in project config gitweb.remoteHeads = 0|1;\n \t'remote_heads' => {\n-\t\t'sub' => sub { feature_bool('remote_heads', @_) },\n+\t\t'sub' => sub { feature_bool('remoteHeads', @_) },\n \t\t'override' => 0,\n \t\t'default' => [0]},\n );\n-- \n1.7.6\n"},{"id":"170984","messageId":"201107072056.25417.jnareb@gmail.com","threadId":"27771","inReplyTo":"1310061739-4441-1-git-send-email-marcnarc@xiplink.com","subject":"Re: [RFC/PATCH] Changed gitweb.remote_heads config key name to gitweb.remoteHeads.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-07-07T18:56:24Z","receivedAt":"2011-07-07T18:56:24Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Thu, 7 Jul 2011, Marc Branchaud wrote:\n\n> Git doesn't accept config key names with underscore characters.\n\nHmmm... that is strange.  Git accepts '-' (though it is discouraged)\nbut not '_' in config key names.\n\n> Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\nWith the caveat that included patch must be applied first,\nsee below.\n\n> ---\n> \n> Came across this today.  The patch is RFC because I have not verified \n> if it's complete or if gitweb even respects the setting.\n> \n>  gitweb/gitweb.perl |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 81dacf2..edbb080 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -524,9 +524,9 @@ our %feature = (\n>  \t# $feature{'remote_heads'}{'default'} = [1];\n>  \t# To have project specific config enable override in $GITWEB_CONFIG\n>  \t# $feature{'remote_heads'}{'override'} = 1;\n> -\t# and in project config gitweb.remote_heads = 0|1;\n> +\t# and in project config gitweb.remoteHeads = 0|1;\n\nKey names are case insensitive...\n\n>  \t'remote_heads' => {\n> -\t\t'sub' => sub { feature_bool('remote_heads', @_) },\n> +\t\t'sub' => sub { feature_bool('remoteHeads', @_) },\n\n...but git_get_project_config didn't respect that.  With above, and\nwithout included patch, gitweb would get from \"git config --list -z\"\n'gitweb.remoteheads' (turned lowercase), but as it is written here\nit would check if 'gitweb.remoreHeads' key exists... so it would\nnever match.\n\n-- >8 --\nFrom: Jakub Narebski <jnareb@gmail.com>\nDate: Thu, 7 Jul 2011 20:48:50 +0200\nSubject: [PATCH] gitweb: Make git config search case insensitive\n\nGitweb does not (yet?) use git config variables with subsection, so we\ncan simply lowercase $key in git_get_project_config: section name and\nkey name are case insensitive (only subsection name is case\nsensitive).\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 589c85b..59147b6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2526,6 +2526,7 @@ sub git_get_project_config {\n \n \t# key sanity check\n \treturn unless ($key);\n+\t$key = lc($key); # assuming there is no subsection\n \t$key =~ s/^gitweb\\.//;\n \treturn if ($key =~ m/\\W/);\n \n-- \n1.7.5\n"},{"id":"170994","messageId":"201107072236.51183.jnareb@gmail.com","threadId":"27771","inReplyTo":"201107072056.25417.jnareb@gmail.com","subject":"Re: [RFC/PATCH] Changed gitweb.remote_heads config key name to gitweb.remoteHeads.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-07-07T20:36:50Z","receivedAt":"2011-07-07T20:36:50Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"> -- >8 --\n> From: Jakub Narebski <jnareb@gmail.com>\n> Date: Thu, 7 Jul 2011 20:48:50 +0200\n> Subject: [PATCH] gitweb: Make git config search case insensitive\n\nI should have probably add here the following:\n\n  The section and key part of fully qualified name of config variable\n  are case insensitive in git.  \"git config --list -z\" that gitweb uses\n  returns them lowercased.\n \n> Gitweb does not (yet?) use git config variables with subsection, so we\n> can simply lowercase $key in git_get_project_config: section name and\n> key name are case insensitive (only subsection name is case\n> sensitive).\n> \n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n\nYet another case where commit message is longer than fix... ;-)\n\n>  gitweb/gitweb.perl |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 589c85b..59147b6 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -2526,6 +2526,7 @@ sub git_get_project_config {\n>  \n>  \t# key sanity check\n>  \treturn unless ($key);\n> +\t$key = lc($key); # assuming there is no subsection\n>  \t$key =~ s/^gitweb\\.//;\n>  \treturn if ($key =~ m/\\W/);\n>  \n> -- \n> 1.7.5\n> \n> \n\n-- \nJakub Narebski\nPoland\n"}]}