* [PATCH 0/1] : [GITWEB] : Git link on project list page @ 2008-08-04 2:00 warthog19 2008-08-04 2:00 ` [PATCH 1/1] Add "git" link to the end of project line on the project_list page warthog19 0 siblings, 1 reply; 5+ messages in thread From: warthog19 @ 2008-08-04 2:00 UTC (permalink / raw) To: git This is a quick port of the git link patch that's present on kernel.org's gitweb, project list page. - John 'Warthog9' Hawley ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] Add "git" link to the end of project line on the project_list page. 2008-08-04 2:00 [PATCH 0/1] : [GITWEB] : Git link on project list page warthog19 @ 2008-08-04 2:00 ` warthog19 2008-08-04 2:26 ` Petr Baudis 0 siblings, 1 reply; 5+ messages in thread From: warthog19 @ 2008-08-04 2:00 UTC (permalink / raw) To: git; +Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley [-- Attachment #1: Type: text/plain, Size: 44 bytes --] This is a multi-part message in MIME format. [-- Attachment #2: Type: text/plain, Size: 390 bytes --] This makes the assumption that all repositories are available from a unified location. Using .git/cloneurl is actually a problem as that can define multiple URLs to clone from, and we are seeking a single unified URL for now. Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net> --- gitweb/gitweb.perl | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: 07ce8f81cc06027c9c166cf316238d7a4af17162.diff --] [-- Type: text/x-patch; name="07ce8f81cc06027c9c166cf316238d7a4af17162.diff", Size: 1619 bytes --] 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). @@ -3661,8 +3669,11 @@ sub git_project_list_body { $cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"tree")}, "tree") . - ($pr->{'forks'} ? " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "forks") : '') . - "</td>\n" . + ($pr->{'forks'} ? " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "forks") : ''); + if( $projectlist_gitlinkurl != undef && $projectlist_gitlinkurl ne "" ){ + print " | ". $cgi->a({-href => "git://projectlist_gitlinkurl/".esc_html($pr->{'path'})}, "git"); + } + print "</td>\n" . "</tr>\n"; } if (defined $extra) { ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] Add "git" link to the end of project line on the project_list page. 2008-08-04 2:00 ` [PATCH 1/1] Add "git" link to the end of project line on the project_list page warthog19 @ 2008-08-04 2:26 ` Petr Baudis 2008-08-04 2:38 ` J.H. 0 siblings, 1 reply; 5+ messages in thread From: Petr Baudis @ 2008-08-04 2:26 UTC (permalink / raw) To: warthog19; +Cc: git, John 'Warthog9' Hawley 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). Note that I will soon submit a generic patch that lets you extend the link lists with custom entries - you could easily use that for the git links (I'm personally not convinced how useful they really are on the project list page), I will use them for the graphiclog, edit and fork links at repo.or.cz. > + print " | ". $cgi->a({-href => "git://projectlist_gitlinkurl/".esc_html($pr->{'path'})}, "git"); You meant $projectlist_gitlinkurl. -- Petr "Pasky" Baudis The next generation of interesting software will be done on the Macintosh, not the IBM PC. -- Bill Gates ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] Add "git" link to the end of project line on the project_list page. 2008-08-04 2:26 ` Petr Baudis @ 2008-08-04 2:38 ` J.H. 2008-08-04 3:20 ` Petr Baudis 0 siblings, 1 reply; 5+ messages in thread From: J.H. @ 2008-08-04 2:38 UTC (permalink / raw) To: Petr Baudis; +Cc: git 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). > > Note that I will soon submit a generic patch that lets you extend > the link lists with custom entries - you could easily use that for > the git links (I'm personally not convinced how useful they really are > on the project list page), I will use them for the graphiclog, edit and > fork links at repo.or.cz. I've found them useful, and there were requests out on the mailing list for this to be added, thus the patching. It's not on by default, so it's impact should be minimal unless people specifically want the link. > > > + 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? - John 'Warthog9' Hawley ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] Add "git" link to the end of project line on the project_list page. 2008-08-04 2:38 ` J.H. @ 2008-08-04 3:20 ` Petr Baudis 0 siblings, 0 replies; 5+ messages in thread From: Petr Baudis @ 2008-08-04 3:20 UTC (permalink / raw) To: J.H.; +Cc: git On Sun, Aug 03, 2008 at 07:38:37PM -0700, J.H. wrote: > 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? > > > + 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-08-04 3:21 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-08-04 2:00 [PATCH 0/1] : [GITWEB] : Git link on project list page warthog19 2008-08-04 2:00 ` [PATCH 1/1] Add "git" link to the end of project line on the project_list page warthog19 2008-08-04 2:26 ` Petr Baudis 2008-08-04 2:38 ` J.H. 2008-08-04 3:20 ` Petr Baudis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox