* [PATCH] avoid gitweb uninitialized value warning
@ 2008-09-05 18:26 Joey Hess
2008-09-18 15:13 ` Jakub Narebski
0 siblings, 1 reply; 2+ messages in thread
From: Joey Hess @ 2008-09-05 18:26 UTC (permalink / raw)
To: git
In the ususual case when there is no commit message, gitweb would
output an uninitialized value warning.
Signed-off-by: Joey Hess <joey@kitenet.net>
---
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 "") {
$co{'title'} = $co{'title_short'} = '(no commit message)';
}
# remove added spaces
--
1.5.6.5
--
see shy jo
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] avoid gitweb uninitialized value warning
2008-09-05 18:26 [PATCH] avoid gitweb uninitialized value warning Joey Hess
@ 2008-09-18 15:13 ` Jakub Narebski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Narebski @ 2008-09-18 15:13 UTC (permalink / raw)
To: Joey Hess; +Cc: git
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>
> ---
> 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 "") {
> $co{'title'} = $co{'title_short'} = '(no commit message)';
> }
> # remove added spaces
> --
> 1.5.6.5
>
> --
> see shy jo
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-18 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-05 18:26 [PATCH] avoid gitweb uninitialized value warning Joey Hess
2008-09-18 15:13 ` Jakub Narebski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.