Thread (1 message) 1 message, 1 author, 2016-06-15
  • (off-list ancestor, not in this archive)
  • Re: Fwd: Gitweb error · Jakub Narebski <hidden> · 2016-06-15

Re: Fwd: Gitweb error

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:52:52

On Fri, 27 Jan 2012, rajesh boyapati wrote:
On Fri, Jan 27, 2012 at 3:39 PM, Jakub Narebski [off-list ref] wrote:
quoted
rajesh boyapati [off-list ref] writes:
quoted
quoted
When I go to one of the projects in gerrit through gitweb and when I
click "summary", I am getting the below error.
If I click other tabs(log, shortlog, commit, tree,etc) after clicking
"summary", I am getting following error in error-log.
If I click other tabs(log, shortlog, commit, tree,etc) before clicking
"summary", everything works fine.
It is strange that you get an intermittent error like this, and make
it even harder to debug - HTTP is stateless.
quoted
quoted
Error:
=================================================================
[2012-01-25 18:50:32,334] ERROR
com.google.gerrit.httpd.gitweb.GitWebServlet : CGI: [Wed Jan 25
18:50:32 2012] gitweb.cgi: Use of uninitialized value $head in string
eq at /usr/lib/cgi-bin/gitweb.cgi line 4720.
Could you show this line and about 3 lines of context in your
gitweb.cgi?
    my $alternate = 1;
    for (my $i = $from; $i <= $to; $i++) {
        my $entry = $headlist->[$i];
        my %ref = %$entry;
        my $curr = $ref{'id'} eq $head;
        if ($alternate) {
            print "<tr class=\"dark\">\n";
        } else {
            print "<tr class=\"light\">\n";
        }
        $alternate ^= 1;
 
Hmmmm... I see that we do not check if $head is defined here before using
it.  This can happen legitimately if we are on yet to be born orphan branch
(so $head, which should be named $head_at, is undefined) but there exist
other branches (so $headlist is not empty).

But I don't think it is what happened in your case, is it?

[...]
-- 
Jakub Narebski
Poland
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help