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

Re: gitweb.cgi bug

From
DSDongsheng Song <dongsheng.song@gmail.com>
Date
Feb 9, 2014, 03:19 UTC
Message-ID
<CAE8XmWo-SiRTZjUt9Z2UZeJW21NuKEgf1J43QS4HECPBA4ceWA@mail.gmail.com>
In-Reply-To
<0FE68796-BA98-4DF7-AD30-C42D78A87DCE@kellerfarm.com>
On Sun, Feb 9, 2014 at 12:29 AM, Andrew Keller <andrew@kellerfarm.com> wrote:
Show 24 quoted lines
> On Feb 8, 2014, at 8:37 AM, Dongsheng Song wrote:
>
>> I have an git repo PROJECT.git, the full path is /srv/repo/git/PROJECT.git,
>> when I set git_base_url_list in gitweb.conf:
>>
>> @git_base_url_list = qw(https://192.168.30.239/repo/git
>>                            git@192.168.30.239:repo/git);
>>
>> I got the result:
>>
>> https://192.168.30.239/repo/git/PROJECT.git
>> git@192.168.30.239:/PROJECT.git
>>
>> This is wrong, it should be (without the leading '/')
>> git@192.168.30.239:PROJECT.git
>
> There is no way to generate a fetch url of 'git@192.168.30.239:PROJECT.git' in gitweb.
>
> If one of the base urls was 'git@192.168.30.239:.', then you could get a fetch URL of 'git@192.168.30.239:./PROJECT.git'
>
> In general, though, I like to stay away from relative paths.  Weird things can happen, like HTTP works but SSH doesn't, because the home directory for SSH changed because you used a different user.
>
>  - Andrew
>
What's about the following translate rules ?

git@192.168.30.239: -> git@192.168.30.239:PROJECT.git git@192.168.30.239:/ -> git@192.168.30.239:/PROJECT.git git@192.168.30.239:/repo -> git@192.168.30.239:/repo/PROJECT.git git@192.168.30.239:/repo/ -> git@192.168.30.239:/repo/PROJECT.git

I don't know Perl, but I think change the following translate code is not a hard work:

        # use per project git URL list in $projectroot/$project/cloneurl
        # or make project git URL from git base URL and project name
        my $url_tag = "URL";
        my @url_list = git_get_project_url_list($project);
        @url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
        foreach my $git_url (@url_list) {
                next unless $git_url;
                print format_repo_url($url_tag, $git_url);
                $url_tag = "";
        }

Regards, Dongsheng

Previous: Andrew KellerNext: Andrew Keller
Message 3 of 5 in “gitweb.cgi bug”
  1. Dongsheng SongFeb 8, 2014
  2. Andrew KellerFeb 8, 2014
  3. Dongsheng SongFeb 9, 2014
  4. Andrew KellerFeb 9, 2014
  5. Dongsheng SongFeb 10, 2014

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.