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

Re: [PATCH try 2] gitweb: Add option to put a trailing slash on pathinfo-style project URLs

From
Matt McCutchen <matt@mattmccutchen.net>
Date
Dec 14, 2008, 01:13 UTC
Message-ID
<1229217235.3360.13.camel@mattlaptop2.local>
In-Reply-To
<cb7bb73a0812131423h1f629ec1n9e8eacd657a4901@mail.gmail.com>
On Sat, 2008-12-13 at 23:23 +0100, Giuseppe Bilotta wrote:
Show 30 quoted lines
> On Sat, Dec 13, 2008 at 10:47 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> > Matt McCutchen <matt@mattmccutchen.net> writes:
> >
> >> My Web site uses pathinfo mode and some rewrite magic to show the gitweb
> >> interface at the URL of the real repository directory (which users also
> >> pull from).  In this case, it's desirable to end generated links to the
> >> project in a trailing slash so the Web server doesn't have to redirect
> >> the client to add the slash.  This patch adds a second element to the
> >> "pathinfo" feature configuration to control the trailing slash.
> >>
> >> Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
> >
> > Did you check that it does not confuse gitweb if filename parameter is
> > passed using pathinfo?  Gitweb used to rely on final '/' to
> > distinguish directory pathnames from ordinary pathnames, but I think
> > currently thanks to the fact that gitweb now embeds action in pathinfo
> > URL, and does not need to guess type, it is not an issue.
> >
> > Or only project URLs (i.e. only with project parameter, i.e. only
> > "http://git.example.com/project.git/" but not other path_info links)
> > have trailing slash added?
> >
> > Errr... I see that it adds trailing slash only for project-only
> > path_info links, but the commit message was not entirely clear for me.
> 
> If indeed the additional / is only asked for in summary view, I think
> there's no need for a feature toggle, we can always put it there. If
> not, I'm really curious about seeing the rewrite rules (they might
> also be worth adding to the gitweb documentation as examples of 'power
> usage').

The trailing slash is used only when the URL refers to a project with no appended parameters (i.e., summary view), because the URL refers to the real git dir on disk (hence, pulling from the same URL) and it plays nicer with the Web server configuration to have the trailing slash.

I was wary about changing the default behavior, but if you and Jakub both think it's OK, that's great.

I was thinking of proposing the addition of some info about my setup, including the rewrite rules, to the documentation. Maybe we could do that after dealing with the patches.

-- 
Matt
Previous: Giuseppe BilottaNext: Jakub Narebski
Message 5 of 11 in “gitweb: Add option to put a trailing slash on pathinfo-style project URLs”
  1. gitweb: Add option to put a trailing slash on pathinfo-style project URLsMatt McCutchen, Dec 13, 2008
  2. gitweb: Add option to put a trailing slash on pathinfo-style project URLsMatt McCutchen, Dec 13, 2008
  3. Jakub NarebskiDec 13, 2008
  4. Giuseppe BilottaDec 13, 2008
  5. Matt McCutchenDec 14, 2008
  6. Jakub NarebskiDec 14, 2008
  7. Jakub NarebskiDec 14, 2008
  8. Junio C HamanoDec 13, 2008
  9. Matt McCutchenDec 14, 2008
  10. Jakub NarebskiDec 14, 2008
  11. Jakub NarebskiDec 14, 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.