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:53

On Mon, 30 Jan 2012, rajesh boyapati wrote:
2012/1/28 Jakub Narebski [off-list ref]
quoted
On Fri, 27 Jan 2012, rajesh boyapati wrote:
quoted
quoted
    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?
tldr; It did happen.
 
For my git projects on gerrit, our main branch name is "base".
We don't have any code on "master" branch.
May be the $HEAD is looking for master branch(or checked out branch in git
project).--> In our case, "master" is an empty branch.
Also, In the git projects, the HEAD file is pointing to "ref:
refs/heads/master".
So, I think that's the reason for errors.

How can I make $HEAD to point to a branch other than "master"?.
  a) I can do this by pointing HEAD file in git projects to other branch
[...]
  b) Is there any way, other than doing above step (a) ?.
     I mean I don't want to have a code on "master" branch and also I
     don't want to point HEAD file in git projects to some other branch.
     Do I need to make any modifications to "gitweb.cgi" for this?
Now that I know the source of this error, I can write test case
for it, and fix it.  I'll try to do it soon.

So finally what you would need for (b) is just upgrade gitweb.
-- 
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