Re: [PATCH 1/1] Add "git" link to the end of project line on the project_list page.
- From
Petr Baudis <pasky@suse.cz>
- Date
- Aug 4, 2008, 03:20 UTC
- Message-ID
- <20080804032044.GG10151@machine.or.cz>
- In-Reply-To
- <1217817517.32240.46.camel@localhost.localdomain>
On Sun, Aug 03, 2008 at 07:38:37PM -0700, J.H. wrote:
Show 21 quoted lines
> On Mon, 2008-08-04 at 04:26 +0200, Petr Baudis wrote: > > On Sun, Aug 03, 2008 at 07:00:17PM -0700, warthog19@eaglescrag.net wrote: > > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > > > index 90cd99b..c33f4ed 100755 > > > --- a/gitweb/gitweb.perl > > > +++ b/gitweb/gitweb.perl > > > @@ -108,6 +108,14 @@ our $mimetypes_file = undef; > > > # could be even 'utf-8' for the old behavior) > > > our $fallback_encoding = 'latin1'; > > > > > > +# enable / disable a final link on the project list page > > > +# that will be the location of that actuall git url > > > +# it will output this in the format: > > > +# git://hostname/path/to/tree.git > > > +# disabled = blank or undef > > > +# enable = url to prefix before filling in the trailing path to the git repo > > > +our $projectlist_gitlinkurl = undef; > > > + > > > # rename detection options for git-diff and git-diff-tree > > > # - default is '-M', with the cost proportional to > > > # (number of removed files) * (number of new files).
By the way, you should add this to gitweb/README too (though I've never been too fond of listing the options twice myself; my strategy to avoid it is to just add as much stuff possible to the $features hash ;-).
> > > + if( $projectlist_gitlinkurl != undef && $projectlist_gitlinkurl ne "" ){Coding style conformant and equivalent but simpler variant would be
if ($projectlist_gitlinkurl) {right?
Show 10 quoted lines
> > > + print " | ". $cgi->a({-href => "git://projectlist_gitlinkurl/".esc_html($pr->{'path'})}, "git");
> >
> > You meant $projectlist_gitlinkurl.
>
> grrr - I've fixed that same bug twice now, had problems with something
> and must have reverted the wrong thing, I'll fix it and re-submit.
>
> When you do the more generic patch to extend the links I'll flip this
> over to that code, unless you think it's worth holding off and waiting
> for that change to go in first?It's a new feature so it probably won't make it to 1.6.0 - so let's see if I manage to submit mine before 1.6.0. ;-)
-- Petr "Pasky" Baudis The next generation of interesting software will be done on the Macintosh, not the IBM PC. -- Bill Gates