{"thread":{"id":"15386","subject":"[PATCH] avoid gitweb uninitialized value warning","startedAt":"2008-09-05T18:26:29Z","lastAt":"2008-09-18T15:13:35Z","messageCount":2,"participants":["Joey Hess","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"89859","messageId":"20080905182629.GA22030@kodama.kitenet.net","threadId":"15386","inReplyTo":null,"subject":"[PATCH] avoid gitweb uninitialized value warning","fromName":"Joey Hess","fromEmail":"joey@kitenet.net","sentAt":"2008-09-05T18:26:29Z","receivedAt":"2008-09-05T18:26:29Z","isPatch":true,"sender":{"key":"joey@kitenet.net","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"In the ususual case when there is no commit message, gitweb would\noutput an uninitialized value warning.\n\nSigned-off-by: Joey Hess <joey@kitenet.net>\n---\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 29e2156..da474d0 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2123,7 +2123,7 @@ sub parse_commit_text {\n \t\t\tlast;\n \t\t}\n \t}\n-\tif ($co{'title'} eq \"\") {\n+\tif (! defined $co{'title'} || $co{'title'} eq \"\") {\n \t\t$co{'title'} = $co{'title_short'} = '(no commit message)';\n \t}\n \t# remove added spaces\n-- \n1.5.6.5\n\n-- \nsee shy jo\n"},{"id":"91028","messageId":"m3abe5mqs8.fsf@localhost.localdomain","threadId":"15386","inReplyTo":"20080905182629.GA22030@kodama.kitenet.net","subject":"Re: [PATCH] avoid gitweb uninitialized value warning","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-18T15:13:35Z","receivedAt":"2008-09-18T15:13:35Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Joey Hess <joey@kitenet.net> writes:\n> Subject: [PATCH] avoid gitweb uninitialized value warning\n\nI would say _where_ this uninitialized value warning was, e.g.\n\nSubject: [PATCH] gitweb: avoid warnings for commits with no body\n\n>\n> In the ususual case when there is no commit message, gitweb would\n> output an uninitialized value warning.\n\nTypo: s/ususual/unusual/\n\n> \n> Signed-off-by: Joey Hess <joey@kitenet.net>\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n> ---\n>  gitweb/gitweb.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 29e2156..da474d0 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -2123,7 +2123,7 @@ sub parse_commit_text {\n>  \t\t\tlast;\n>  \t\t}\n>  \t}\n> -\tif ($co{'title'} eq \"\") {\n> +\tif (! defined $co{'title'} || $co{'title'} eq \"\") {\n\nI would avoid space between logical negation operator '!' and\nits operand, i.e. I would write:\n\n+\tif (!defined $co{'title'} || $co{'title'} eq \"\") {\n\n>  \t\t$co{'title'} = $co{'title_short'} = '(no commit message)';\n>  \t}\n>  \t# remove added spaces\n> -- \n> 1.5.6.5\n> \n> -- \n> see shy jo\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}