From: "Raphaël Gertz via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Raphaël Gertz" <git@rapsys.eu>
Subject: [PATCH] commit:fix use of uninitialized value [...] in server log
Date: Sat, 25 Apr 2020 20:42:18 +0000 [thread overview]
Message-ID: <pull.767.git.git.1587847338677.gitgitgadget@gmail.com> (raw)
From: =?UTF-8?q?Rapha=C3=ABl=20Gertz?= <git@rapsys.eu>
This change fix the message about uninitialized value when trying to
access undefined hash indexes.
The error message fixed:
Use of uninitialized value $params{"action"} in string eq at gitweb.cgi
line 1377
Add myself as warning fix author.
Signed-off-by: Raphaël Gertz <git@rapsys.eu>
---
gitweb: fix tests on uninitialized hash indexes to avoid uninitialized
value warnings in server log
It's happened that I tried to solve lots of meaningless warnings in web
server error log.
I think it makes no sense to spam error log with warnings about
uninitialized value when trying to run careless tests on undefined hash
indexes.
This is a simple fix that I did long ago that check carefully the index
before running tests on it.
I added myself as warning fix author as well.
My goal is to avoid re-applying the patch on each distribution update.
The warning message fixed in web server error log : Use of uninitialized
value $params{"action"} in string eq at gitweb.cgi line 1377
Raphaël Gertz: gitweb/README: add myself as warning fix author
gitweb/gitweb.perl: fix careless test on undefined hash indexes
gitweb/README | 3 +++ gitweb/gitweb.perl | 4 ++-- 2 files changed, 5
insertions(+), 2 deletions(-)
Signed-off-by: Raphaël Gertz git@rapsys.eu [git@rapsys.eu]
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-767%2Frapsys%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-767/rapsys/master-v1
Pull-Request: https://github.com/git/git/pull/767
gitweb/README | 3 +++
gitweb/gitweb.perl | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gitweb/README b/gitweb/README
index 471dcfb691b..8964478a3fc 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -66,5 +66,8 @@ AUTHORS
Originally written by:
Kay Sievers <kay.sievers@vrfy.org>
+Perl warning fix:
+ Raphaël Gertz <git@rapsys.eu>
+
Any comment/question/concern to:
Git mailing list <git@vger.kernel.org>
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1a02a1242d5..37dfce202a0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1420,7 +1420,7 @@ sub href {
# since we destructively absorb parameters, we keep this
# boolean that remembers if we're handling a snapshot
- my $is_snapshot = $params{'action'} eq 'snapshot';
+ my $is_snapshot = defined $params{'action'} && $params{'action'} eq 'snapshot';
# Summary just uses the project path URL, any other action is
# added to the URL
@@ -6012,7 +6012,7 @@ sub git_history_body {
$cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype) . " | " .
$cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff");
- if ($ftype eq 'blob') {
+ if (defined $ftype && $ftype eq 'blob') {
print " | " .
$cgi->a({-href => href(action=>"blob_plain", hash_base=>$commit, file_name=>$file_name)}, "raw");
base-commit: e870325ee8575d5c3d7afe0ba2c9be072c692b65
--
gitgitgadget
next reply other threads:[~2020-04-25 20:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 20:42 Raphaël Gertz via GitGitGadget [this message]
2020-04-26 0:17 ` [PATCH] commit:fix use of uninitialized value [...] in server log Jonathan Nieder
2020-04-26 6:17 ` Raphaël Gertz
2020-04-25 20:43 Raphaël Gertz via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.767.git.git.1587847338677.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@rapsys.eu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.