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

Re: [PATCH (BUGFIX)] gitweb: Fix "Use of uninitialized value" error in 'history' view

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 5, 2008, 08:09 UTC
Message-ID
<200804051009.13332.jnareb@gmail.com>
In-Reply-To
<7v63uwyc14.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > When asked for history of a file with no $hash ('h') parameter set,
> > and which file is not present in current branch ("HEAD" or given by
> > $hash_hase ('hb') parameter), but is present deeper in the full
> > history of a branch, gitweb would spew multiple of "Use of
> > uninitialized value" warnings, and some links would be missing.
> > This commit fixes this bug.
> 
> Thanks, does gitweb itself generate such a link?
> 
> I can _artificially_ reproduce this, and I can also see that the patch
> would solve it, so I do not mind applying it, but I am curious how this
> was originally triggered.

Actually I came across this error when testing the "context-sensitive feed links" patch, and was hand-crafting (munging) gitweb URLs.

But after thinking about this bug a bit I have realized that this situation _can_ happen with link generated by gitweb, only in very rare cases. It is enough if you use 'history' view link without $hash ('h') parameter, and with transient $hash_base ('hb') parameter, i.e. either name of branch, or "HEAD", or not set (implies "HEAD"), and happen into situation where file was _deleted_ *between* gitweb link creation and following (accessing) this link. For example 'history' links in 'tree' and 'commitdiff' views doesn't have 'h' parameter. Also the 'history' link in navigation bar wouldn't have 'h' parameter if 'blob' or 'tree' view where it is in doesn't have it.

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Gerrit Pape
Message 3 of 8 in “gitweb: Fix "Use of uninitialized value" error in 'history' view”
  1. gitweb: Fix "Use of uninitialized value" error in 'history' viewJakub Narebski, Apr 4, 2008
  2. Junio C HamanoApr 5, 2008
  3. Jakub NarebskiApr 5, 2008
  4. Gerrit PapeApr 5, 2008
  5. Jakub NarebskiApr 5, 2008
  6. Jakub NarebskiApr 5, 2008
  7. Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output"Jakub Narebski, Apr 5, 2008
  8. Gerrit PapeApr 6, 2008

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.