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

Re: [PATCH] gitweb: make feature_blame return a list

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Dec 15, 2008, 22:52 UTC
Message-ID
<gi6n3m$kvc$1@ger.gmane.org>
In-Reply-To
<7v7i61w06k.fsf@gitster.siamese.dyndns.org>
On Monday 15 December 2008 23:20, Junio C Hamano wrote:
Show 32 quoted lines
> Matt Kraai <kraai@ftbfs.org> writes:
> 
>> The feature defaults are expected to be a list, but feature_blame was
>> returning a scalar.  This change makes it consistent with the other
>> boolean feature subroutines.
>>
>> Signed-off-by: Matt Kraai <kraai@ftbfs.org>
>> ---
>>  gitweb/gitweb.perl |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index 6eb370d..145e712 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -367,12 +367,12 @@ sub feature_blame {
>>      my ($val) = git_get_project_config('blame', '--bool');
>>  
>>      if ($val eq 'true') {
>> -            return 1;
>> +            return (1);
>>      } elsif ($val eq 'false') {
>> -            return 0;
>> +            return (0);
>>      }
>>  
>> -    return $_[0];
>> +    return ($_[0]);
>>  }
> 
> My Perl may be getting rusty, but does the above make any difference?
> How?

It's formally more correct and makes the blame feature fit with the general feature framework, although the feature works correctly even without the (). I was actually going to send a similar patch myself, having missed it during the cleanup and get/check splitup patchset.

Matt's patch gets my Ack, for what it's worth.
-- 
Giuseppe "Oblomov" Bilotta
Previous: Junio C HamanoNext: Matt Kraai
Message 5 of 13 in “gitweb: make feature_blame return a list”
  1. gitweb: make feature_blame return a listMatt Kraai, Dec 15, 2008
  2. gitweb: unify boolean feature subroutinesMatt Kraai, Dec 15, 2008
  3. Junio C HamanoDec 15, 2008
  4. Junio C HamanoDec 15, 2008
  5. Giuseppe BilottaDec 15, 2008
  6. Matt KraaiDec 16, 2008
  7. Junio C HamanoDec 16, 2008
  8. gitweb: unify boolean feature subroutinesMatt Kraai, Dec 16, 2008
  9. gitweb: pass the option name to the feature callbackMatt Kraai, Dec 16, 2008
  10. Junio C HamanoDec 16, 2008
  11. Matt KraaiDec 16, 2008
  12. Petr BaudisDec 17, 2008
  13. Junio C HamanoDec 17, 2008

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.