{"thread":{"id":"53309","subject":"PullRequest: gitweb.perl: fix 'Use of uninitialized value $params{\"action\"} in string eq at gitweb.cgi line 1377'","startedAt":"2020-04-24T14:52:59Z","lastAt":"2020-04-25T13:46:30Z","messageCount":2,"participants":["Raphaël Gertz","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"396133","messageId":"903700aa01abb139e9bf422835b26ca2@rapsys.eu","threadId":"53309","inReplyTo":null,"subject":"PullRequest: gitweb.perl: fix 'Use of uninitialized value $params{\"action\"} in string eq at gitweb.cgi line 1377'","fromName":"Raphaël Gertz","fromEmail":"git@rapsys.eu","sentAt":"2020-04-24T13:34:43Z","receivedAt":"2020-04-24T14:52:59Z","isPatch":false,"sender":{"key":"git@rapsys.eu","avatar":null},"body":"Hi,\n\nThis is a small fix in gitweb/gitweb.perl script that I tried to get \napplied long ago.\n\nThe current gitweb.perl cgi script generate lots of warnings in the web \nserver logs without reason by skipping defined test.\n\nPull request was done here against \"maint\" branch :\nhttps://github.com/gitgitgadget/git/pull/617\n\nPull request was done here against \"master\" branch if required :\nhttps://github.com/git/git/pull/767\n\nThe change patch is attached if required.\n\nMay you plz merge my change ?\n\nBest regards\n\ndiff -urNp gitweb/gitweb.perl.orig gitweb/gitweb.perl\n--- gitweb/gitweb.perl.orig\t2019-11-14 07:39:24.244704744 +0100\n+++ gitweb/gitweb.perl\t2019-11-14 07:33:50.641602829 +0100\n@@ -1374,7 +1374,7 @@ sub href {\n \n \t\t# since we destructively absorb parameters, we keep this\n \t\t# boolean that remembers if we're handling a snapshot\n-\t\tmy $is_snapshot = $params{'action'} eq 'snapshot';\n+\t\tmy $is_snapshot = defined $params{'action'} && $params{'action'} eq 'snapshot';\n \n \t\t# Summary just uses the project path URL, any other action is\n \t\t# added to the URL\n@@ -5959,7 +5959,7 @@ sub git_history_body {\n \t\t      $cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype) . \" | \" .\n \t\t      $cgi->a({-href => href(action=>\"commitdiff\", hash=>$commit)}, \"commitdiff\");\n \n-\t\tif ($ftype eq 'blob') {\n+\t\tif (defined $ftype && $ftype eq 'blob') {\n \t\t\tprint \" | \" .\n \t\t\t      $cgi->a({-href => href(action=>\"blob_plain\", hash_base=>$commit, file_name=>$file_name)}, \"raw\");\n \ndiff -urNp gitweb/README.orig gitweb/README\n--- gitweb/README.orig\t2019-11-14 07:39:24.244704744 +0100\n+++ gitweb/README\t2019-11-14 07:33:50.641602829 +0100\n@@ -66,5 +66,8 @@ AUTHORS\n Originally written by:\n   Kay Sievers <kay.sievers@vrfy.org>\n \n+Perl warning fix:\n+  Raphaël Gertz <git@rapsys.eu>\n+\n Any comment/question/concern to:\n   Git mailing list <git@vger.kernel.org>\n"},{"id":"396253","messageId":"nycvar.QRO.7.76.6.2004251545140.18039@tvgsbejvaqbjf.bet","threadId":"53309","inReplyTo":"903700aa01abb139e9bf422835b26ca2@rapsys.eu","subject":"Re: PullRequest: gitweb.perl: fix 'Use of uninitialized value $params{\"action\"} in string eq at gitweb.cgi line 1377'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-04-25T13:46:21Z","receivedAt":"2020-04-25T13:46:30Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Raphaël,\n\nOn Fri, 24 Apr 2020, Raphaël Gertz wrote:\n\n> This is a small fix in gitweb/gitweb.perl script that I tried to get applied\n> long ago.\n>\n> The current gitweb.perl cgi script generate lots of warnings in the web server\n> logs without reason by skipping defined test.\n>\n> Pull request was done here against \"maint\" branch :\n> https://github.com/gitgitgadget/git/pull/617\n\nAs pointed out by GitGitGadget's Welcome message at\nhttps://github.com/git/git/pull/767#issuecomment-618976608, the idea is\nthat you submit the patches to the mailing list by adding a comment to the\nPR that says `/submit`.\n\nCiao,\nJohannes\n"}]}