git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2010, 17:56 UTC
Message-ID
<7vpr2ktlxa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201003311947.33587.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> Ping!  This patch is straight fix for a recently introduced bug
> (in a bugfix)... and it removes more than it adds.

I took your "Does this fix?" as a request for Tested-By: and has been waiting for the exchange between you two to move forward.

I'll queue it; thanks for the reminder.
Show 58 quoted lines
>
> On Sat, 27 Mar 2010, Jakub Narebski wrote:
>> On Sat, 27 Mar 2010, Tobias Heinlein wrote:
>> 
>> > I stumbled upon a small bug in gitweb that was introduced by commit
>> > 9be3614eff36271d5f1cd460a568a219902cb044.
>> > 
>> > The projects list page is no longer able to display the projects'
>> > descriptions and owners properly when they are set in the git config
>> > file, e.g. like this:
>> > 
>> >   [gitweb]
>> >           owner = Tobias Heinlein
>> >           description = test
> [...]
>
>> Does the following patch fixes this issue?
>> 
>> -- >8 --
>> From: Jakub Narebski <jnareb@gmail.com>
>> Date: Sat, 27 Mar 2010 20:26:59 +0100
>> Subject: [PATCH] gitweb: git_get_project_config requires only $git_dir, not also $project
>> 
>> Fix overeager early return in git_get_project_config, introduced in 9be3614
>> (gitweb: Fix project-specific feature override behavior, 2010-03-01).  When
>> git_get_project_config is called from projects list page via
>> git_get_project_owner($path) etc., it is called with $git_dir defined (in
>> git_get_project_owner($path) etc.), but $project variable is not defined.
>> git_get_project_config doesn't use $project variable anyway.
>> 
>> Reported-by: Tobias Heinlein <keytoaster@gentoo.org>
>> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
>> ---
>>  gitweb/gitweb.perl |    3 +--
>>  1 files changed, 1 insertions(+), 2 deletions(-)
>> 
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index a2d2283..c356e95 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -2216,8 +2216,7 @@ sub config_to_multi {
>>  sub git_get_project_config {
>>  	my ($key, $type) = @_;
>>  
>> -	# do we have project
>> -	return unless (defined $project && defined $git_dir);
>> +	return unless defined $git_dir;
>>  
>>  	# key sanity check
>>  	return unless ($key);
>> -- 
>> 1.7.0.1
>> 
>> 
>
> -- 
> Jakub Narebski
> Poland
Previous: Jakub Narebski
Message 3 of 3 in “gitweb: git_get_project_config requires only $git_dir, not also $project”
  1. gitweb: git_get_project_config requires only $git_dir, not also $projectJakub Narebski, Mar 27, 2010
  2. Jakub NarebskiMar 31, 2010
  3. Junio C HamanoMar 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.