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

Re: [PATCH] avoid gitweb uninitialized value warning

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 18, 2008, 15:13 UTC
Message-ID
<m3abe5mqs8.fsf@localhost.localdomain>
In-Reply-To
<20080905182629.GA22030@kodama.kitenet.net>
Joey Hess <joey@kitenet.net> writes:
> Subject: [PATCH] avoid gitweb uninitialized value warning
I would say _where_ this uninitialized value warning was, e.g.
Subject: [PATCH] gitweb: avoid warnings for commits with no body
>
> In the ususual case when there is no commit message, gitweb would
> output an uninitialized value warning.
Typo: s/ususual/unusual/
> 
> Signed-off-by: Joey Hess <joey@kitenet.net>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Show 14 quoted lines
> ---
>  gitweb/gitweb.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 29e2156..da474d0 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -2123,7 +2123,7 @@ sub parse_commit_text {
>  			last;
>  		}
>  	}
> -	if ($co{'title'} eq "") {
> +	if (! defined $co{'title'} || $co{'title'} eq "") {

I would avoid space between logical negation operator '!' and its operand, i.e. I would write:

+	if (!defined $co{'title'} || $co{'title'} eq "") {
Show 8 quoted lines
>  		$co{'title'} = $co{'title_short'} = '(no commit message)';
>  	}
>  	# remove added spaces
> -- 
> 1.5.6.5
> 
> -- 
> see shy jo
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Joey Hess
Message 2 of 2 in “avoid gitweb uninitialized value warning”
  1. avoid gitweb uninitialized value warningJoey Hess, Sep 5, 2008
  2. Jakub NarebskiSep 18, 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.