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

Re: [PATCH] More flexible URL patterns for gitweb

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 11, 2010, 21:09 UTC
Message-ID
<201004112309.37089.jnareb@gmail.com>
In-Reply-To
<r2te821df551004111046v2ef3219x5c012af27f2cc974@mail.gmail.com>
On Sun, 11 Apr 2010, Damien Tournoud wrote:
> On Sun, Apr 11, 2010 at 7:33 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
> > To not break backward compatibility, wouldn't it be better to check if
> > elements of @git_base_url_list end with ':' or '/', and join base with
> > project path depending on this condition, i.e.:
> >
> > +       @url_list = map { m/[/:]$/ ? "$_$project" : "$_/$project" } @git_base_url_list
> > +               unless @url_list;
> >
> > This means: if base ends with colon ':' or slash '/', concatenate base
> > and project path, otherwise join them using '/' as field separator.
> 
> Thanks for the review. Indeed this way sounds better.
> 
> All this is new to me so I'm not sure what is the way forward. Should
> I publish another patch or would you?

If you don't mind, I'd rather you send updated patch (perhaps as response to this email, or staring a separate thread).

Note that you would need to:
1. Perhaps update first line of commit message, i.e. email subject.
   But current version might be good enough; if you don't change the
   subject you should use [PATCH v2] rather than [PATCH] in it.
2. Update commit message, to say that you are modifying the way project
   URLs shown in gitweb are composed out of bases in @git_base_url_list
   and $project, to allow possibility of generating scp-like relative
   URL for SSH access, e.g. 'git@git.example.com:user/repo.git'
3. You might want to put comment about what changed from previous
   version of the patch between "---\n" and diffstat.
4. You would need to update description of @git_base_url_list in
   gitweb/README, e.g. providing example what to put in @git_base_url_list
   to get 'git@git.example.com:user/repo.git': it is 'git@git.example.com:'
5. Update comment in gitweb.perl above declaration of @git_base_url_list
   to follow modified way of getting URL from base and $project
6. Make above change in git_summary.
P.S. Thank you for contributing to git.
-- 
Jakub Narebski
Poland
Previous: Damien Tournoud
Message 4 of 4 in “More flexible URL patterns for gitweb”
  1. More flexible URL patterns for gitwebDamien Tournoud, Apr 11, 2010
  2. Jakub NarebskiApr 11, 2010
  3. Damien TournoudApr 11, 2010
  4. Jakub NarebskiApr 11, 2010

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.