{"thread":{"id":"23203","subject":"[PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project","startedAt":"2010-03-27T19:27:57Z","lastAt":"2010-03-31T17:56:17Z","messageCount":3,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"137963","messageId":"201003272027.59216.jnareb@gmail.com","threadId":"23203","inReplyTo":"4BAE4F07.3040806@gentoo.org","subject":"[PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-27T19:27:57Z","receivedAt":"2010-03-27T19:27:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sat, 27 Mar 2010, Tobias Heinlein wrote:\n\n> I stumbled upon a small bug in gitweb that was introduced by commit\n> 9be3614eff36271d5f1cd460a568a219902cb044.\n> \n> The projects list page is no longer able to display the projects'\n> descriptions and owners properly when they are set in the git config\n> file, e.g. like this:\n> \n>   [gitweb]\n>           owner = Tobias Heinlein\n>           description = test\n> \n> This is because git_get_project_owner() calls\n> git_get_project_config('owner'):\n> \n>   sub git_get_project_config {\n>           my ($key, $type) = @_;\n> \n>           # do we have project\n>           return unless (defined $project && defined $git_dir);\n> \n> At this point, $project is not defined (because it doesn't have to;\n> $git_dir is defined, though, due to another change in the said\n> commit), causing the call to return early at the newly introduced\n> line of code. \n> \n> Determining the description fails accordingly.\n> \n> I'm afraid I can't provide a patch as my Perl foo isn't that good.\n\nDoes the following patch fixes this issue?\n\n-- >8 --\nFrom: Jakub Narebski <jnareb@gmail.com>\nDate: Sat, 27 Mar 2010 20:26:59 +0100\nSubject: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project\n\nFix overeager early return in git_get_project_config, introduced in 9be3614\n(gitweb: Fix project-specific feature override behavior, 2010-03-01).  When\ngit_get_project_config is called from projects list page via\ngit_get_project_owner($path) etc., it is called with $git_dir defined (in\ngit_get_project_owner($path) etc.), but $project variable is not defined.\ngit_get_project_config doesn't use $project variable anyway.\n\nReported-by: Tobias Heinlein <keytoaster@gentoo.org>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex a2d2283..c356e95 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2216,8 +2216,7 @@ sub config_to_multi {\n sub git_get_project_config {\n \tmy ($key, $type) = @_;\n \n-\t# do we have project\n-\treturn unless (defined $project && defined $git_dir);\n+\treturn unless defined $git_dir;\n \n \t# key sanity check\n \treturn unless ($key);\n-- \n1.7.0.1\n"},{"id":"138300","messageId":"201003311947.33587.jnareb@gmail.com","threadId":"23203","inReplyTo":"201003272027.59216.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-31T17:47:31Z","receivedAt":"2010-03-31T17:47:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ping!  This patch is straight fix for a recently introduced bug\n(in a bugfix)... and it removes more than it adds.\n\nOn Sat, 27 Mar 2010, Jakub Narebski wrote:\n> On Sat, 27 Mar 2010, Tobias Heinlein wrote:\n> \n> > I stumbled upon a small bug in gitweb that was introduced by commit\n> > 9be3614eff36271d5f1cd460a568a219902cb044.\n> > \n> > The projects list page is no longer able to display the projects'\n> > descriptions and owners properly when they are set in the git config\n> > file, e.g. like this:\n> > \n> >   [gitweb]\n> >           owner = Tobias Heinlein\n> >           description = test\n[...]\n\n> Does the following patch fixes this issue?\n> \n> -- >8 --\n> From: Jakub Narebski <jnareb@gmail.com>\n> Date: Sat, 27 Mar 2010 20:26:59 +0100\n> Subject: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project\n> \n> Fix overeager early return in git_get_project_config, introduced in 9be3614\n> (gitweb: Fix project-specific feature override behavior, 2010-03-01).  When\n> git_get_project_config is called from projects list page via\n> git_get_project_owner($path) etc., it is called with $git_dir defined (in\n> git_get_project_owner($path) etc.), but $project variable is not defined.\n> git_get_project_config doesn't use $project variable anyway.\n> \n> Reported-by: Tobias Heinlein <keytoaster@gentoo.org>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n>  gitweb/gitweb.perl |    3 +--\n>  1 files changed, 1 insertions(+), 2 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index a2d2283..c356e95 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -2216,8 +2216,7 @@ sub config_to_multi {\n>  sub git_get_project_config {\n>  \tmy ($key, $type) = @_;\n>  \n> -\t# do we have project\n> -\treturn unless (defined $project && defined $git_dir);\n> +\treturn unless defined $git_dir;\n>  \n>  \t# key sanity check\n>  \treturn unless ($key);\n> -- \n> 1.7.0.1\n> \n> \n\n-- \nJakub Narebski\nPoland\n"},{"id":"138302","messageId":"7vpr2ktlxa.fsf@alter.siamese.dyndns.org","threadId":"23203","inReplyTo":"201003311947.33587.jnareb@gmail.com","subject":"Re: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-31T17:56:17Z","receivedAt":"2010-03-31T17:56:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Ping!  This patch is straight fix for a recently introduced bug\n> (in a bugfix)... and it removes more than it adds.\n\nI took your \"Does this fix?\" as a request for Tested-By: and has been\nwaiting for the exchange between you two to move forward.\n\nI'll queue it; thanks for the reminder.\n\n>\n> On Sat, 27 Mar 2010, Jakub Narebski wrote:\n>> On Sat, 27 Mar 2010, Tobias Heinlein wrote:\n>> \n>> > I stumbled upon a small bug in gitweb that was introduced by commit\n>> > 9be3614eff36271d5f1cd460a568a219902cb044.\n>> > \n>> > The projects list page is no longer able to display the projects'\n>> > descriptions and owners properly when they are set in the git config\n>> > file, e.g. like this:\n>> > \n>> >   [gitweb]\n>> >           owner = Tobias Heinlein\n>> >           description = test\n> [...]\n>\n>> Does the following patch fixes this issue?\n>> \n>> -- >8 --\n>> From: Jakub Narebski <jnareb@gmail.com>\n>> Date: Sat, 27 Mar 2010 20:26:59 +0100\n>> Subject: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project\n>> \n>> Fix overeager early return in git_get_project_config, introduced in 9be3614\n>> (gitweb: Fix project-specific feature override behavior, 2010-03-01).  When\n>> git_get_project_config is called from projects list page via\n>> git_get_project_owner($path) etc., it is called with $git_dir defined (in\n>> git_get_project_owner($path) etc.), but $project variable is not defined.\n>> git_get_project_config doesn't use $project variable anyway.\n>> \n>> Reported-by: Tobias Heinlein <keytoaster@gentoo.org>\n>> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n>> ---\n>>  gitweb/gitweb.perl |    3 +--\n>>  1 files changed, 1 insertions(+), 2 deletions(-)\n>> \n>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n>> index a2d2283..c356e95 100755\n>> --- a/gitweb/gitweb.perl\n>> +++ b/gitweb/gitweb.perl\n>> @@ -2216,8 +2216,7 @@ sub config_to_multi {\n>>  sub git_get_project_config {\n>>  \tmy ($key, $type) = @_;\n>>  \n>> -\t# do we have project\n>> -\treturn unless (defined $project && defined $git_dir);\n>> +\treturn unless defined $git_dir;\n>>  \n>>  \t# key sanity check\n>>  \treturn unless ($key);\n>> -- \n>> 1.7.0.1\n>> \n>> \n>\n> -- \n> Jakub Narebski\n> Poland\n"}]}