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

Re: [PATCH] gitweb: fix warnings from dd70235f5a81e (PATH_INFO)

From
Junio C Hamano <junkio@cox.net>
Date
Sep 17, 2006, 21:34 UTC
Message-ID
<7vfyeq2n57.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060917121408.GA19860@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> writes:
> We really need a gitweb test target.
Yes, really.  Any takers who cares truly about gitweb?
Show 7 quoted lines
> Something else I noted:
>> +	while ($project && !-e "$projectroot/$project/HEAD") {
> Evaluating $project boolean value leads to problems if a repository is
> named "0" (I dunno if there are other strings than "" and "0" which
> evaluate to false in perl).  There are multiple places where this is
> used so I did not change it in this patch (even added one more).
> Should this be changed?

Yes, there are tons of places that says if ($foo) and/or while ($bar) and fail miserably when $foo or $bar _can_ be "0". For project names "0" is probably not something people would want to use but there is no inherent reason to forbid it.

How many places, like this, that we should say "defined()" instead in the current code I wonder?

> -	} elsif ($path_info =~ m,^$project/([^/]+)$,) {
> +	} elsif ($project && $path_info =~ m,^$project/([^/]+)$,) {
Previous: Matthias LederhoferNext: Jakub Narebski
Message 4 of 8 in “gitweb: more support for PATH_INFO based URLs”
  1. gitweb: more support for PATH_INFO based URLsMartin Waitz, Sep 16, 2006
  2. Jakub NarebskiSep 16, 2006
  3. gitweb: fix warnings from dd70235f5a81e (PATH_INFO)Matthias Lederhofer, Sep 17, 2006
  4. Junio C HamanoSep 17, 2006
  5. Jakub NarebskiSep 17, 2006
  6. Jakub NarebskiSep 17, 2006
  7. Martin WaitzSep 19, 2006
  8. Jakub NarebskiSep 19, 2006

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.