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

Re: [PATCH] gitweb: more support for PATH_INFO based URLs

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 17, 2006, 13:18 UTC
Message-ID
<eejhtr$paa$1@sea.gmane.org>
In-Reply-To
<20060916210832.GV17042@admingilde.org>
Martin Waitz wrote:
Show 8 quoted lines
> Now three types of path based URLs are supported:
>       gitweb.cgi/project.git
>       gitweb.cgi/project.git/branch
>       gitweb.cgi/project.git/branch/filename
> 
> The first one (show project summary) was already supported for a long time
> now.  The other two are new: they show the shortlog of a branch or
> the plain file contents of some file contained in the repository.
Show 10 quoted lines
> +     if ($path_info =~ m,^$project/([^/]+)/(.+)$,) {
> +             # we got "project.git/branch/filename"
> +             $action    ||= "blob_plain";
> +             $hash_base ||= $1;
> +             $file_name ||= $2;
> +     } elsif ($path_info =~ m,^$project/([^/]+)$,) {
> +             # we got "project.git/branch"
> +             $action ||= "shortlog";
> +             $hash   ||= $1;
> +     }
I'm sorry, but I realized that I didn't think and check this patch through.

First, this patch spews a bunch of warnings: when PATH_INFO is empty, when we undefine $project etc. The patches by me and by matled try to address and remove those warnings, but I'm sure we missed some.

Second, the whole concept of third type of path (path_info) based URL is flawed: branches can also be hierarchical (for example Junio uses <initals>/<topic> topic branches, although they are not published). Therefore it is much harder to distinguish where branchname ends and filename begins. The patch assumes that branches are flat. So for example for branch with the name like "gitweb/xmms2" the types 2 and 3 wouldn't work; and type 1 worked before this patch.

Therefore I rescind my Ack.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Jakub Narebski
Message 5 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.