git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fwd: Gitweb error

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 30, 2012, 19:08 UTC
Message-ID
<201201302008.48421.jnareb@gmail.com>
In-Reply-To
<CA+EqV8xB6vcDrqM3EY7uRfu0c7sOj6FbMXci+5w2qgi5RSWrbw@mail.gmail.com>
On Mon, 30 Jan 2012, rajesh boyapati wrote:
> 2012/1/28 Jakub Narebski <jnareb@gmail.com>
>> On Fri, 27 Jan 2012, rajesh boyapati wrote:
Show 18 quoted lines
>>>     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.
 
Show 10 quoted lines
> 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
Previous: Jakub NarebskiNext: Jakub Narebski
Message 4 of 14 in “Fwd: Git-web error”
  1. rajesh boyapatiJan 27, 2012
  2. Jakub NarebskiJan 27, 2012
  3. Jakub NarebskiJan 29, 2012
  4. Jakub NarebskiJan 30, 2012
  5. gitweb: Deal with HEAD pointing to unborn branch in "heads" viewJakub Narebski, Feb 3, 2012
  6. Jakub NarebskiFeb 7, 2012
  7. gitweb: Harden parse_commit and parse_commitsJakub Narebski, Feb 8, 2012
  8. Jakub NarebskiFeb 9, 2012
  9. gitweb: Silence stderr in parse_commit*() subroutinesJakub Narebski, Feb 11, 2012
  10. Junio C HamanoFeb 13, 2012
  11. Jakub NarebskiFeb 13, 2012
  12. Jakub NarebskiFeb 13, 2012
  13. Jakub NarebskiFeb 13, 2012
  14. Jakub NarebskiFeb 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.