{"thread":{"id":"14827","subject":"[PATCH 0/1] : [GITWEB] : Git link on project list page","startedAt":"2008-08-04T02:00:16Z","lastAt":"2008-08-04T03:20:44Z","messageCount":5,"participants":["warthog19@eaglescrag.net","Petr Baudis","J.H."],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"86137","messageId":"1217815217-11329-1-git-send-email-warthog19@eaglescrag.net","threadId":"14827","inReplyTo":null,"subject":"[PATCH 0/1] : [GITWEB] : Git link on project list page","fromName":"","fromEmail":"warthog19@eaglescrag.net","sentAt":"2008-08-04T02:00:16Z","receivedAt":"2008-08-04T02:00:16Z","isPatch":true,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"\nThis is a quick port of the git link patch that's present on kernel.org's gitweb, project list page.\n\n- John 'Warthog9' Hawley\n"},{"id":"86138","messageId":"1217815217-11329-2-git-send-email-warthog19@eaglescrag.net","threadId":"14827","inReplyTo":"1217815217-11329-1-git-send-email-warthog19@eaglescrag.net","subject":"[PATCH 1/1] Add \"git\" link to the end of project line on the project_list page.","fromName":"","fromEmail":"warthog19@eaglescrag.net","sentAt":"2008-08-04T02:00:17Z","receivedAt":"2008-08-04T02:00:17Z","isPatch":true,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"\nThis makes the assumption that all repositories are available from a unified location.\n\nUsing .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.\n\nSigned-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>\n---\n gitweb/gitweb.perl |   15 +++++++++++++--\n 1 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 90cd99b..c33f4ed 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -108,6 +108,14 @@ our $mimetypes_file = undef;\n # could be even 'utf-8' for the old behavior)\n our $fallback_encoding = 'latin1';\n \n+# enable / disable a final link on the project list page\n+# that will be the location of that actuall git url\n+# it will output this in the format:\n+# git://hostname/path/to/tree.git\n+# disabled = blank or undef\n+# enable = url to prefix before filling in the trailing path to the git repo\n+our $projectlist_gitlinkurl = undef;\n+\n # rename detection options for git-diff and git-diff-tree\n # - default is '-M', with the cost proportional to\n #   (number of removed files) * (number of new files).\n@@ -3661,8 +3669,11 @@ sub git_project_list_body {\n \t\t      $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"shortlog\")}, \"shortlog\") . \" | \" .\n \t\t      $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"log\")}, \"log\") . \" | \" .\n \t\t      $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"tree\")}, \"tree\") .\n-\t\t      ($pr->{'forks'} ? \" | \" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"forks\")}, \"forks\") : '') .\n-\t\t      \"</td>\\n\" .\n+\t\t      ($pr->{'forks'} ? \" | \" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"forks\")}, \"forks\") : '');\n+\t\tif( $projectlist_gitlinkurl != undef && $projectlist_gitlinkurl ne \"\" ){\n+                        print \" | \". $cgi->a({-href => \"git://projectlist_gitlinkurl/\".esc_html($pr->{'path'})}, \"git\");\n+\t\t}\n+\t\tprint \"</td>\\n\" .\n \t\t      \"</tr>\\n\";\n \t}\n \tif (defined $extra) {\n"},{"id":"86139","messageId":"20080804022656.GA32184@machine.or.cz","threadId":"14827","inReplyTo":"1217815217-11329-2-git-send-email-warthog19@eaglescrag.net","subject":"Re: [PATCH 1/1] Add \"git\" link to the end of project line on the project_list page.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-04T02:26:56Z","receivedAt":"2008-08-04T02:26:56Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Aug 03, 2008 at 07:00:17PM -0700, warthog19@eaglescrag.net wrote:\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 90cd99b..c33f4ed 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -108,6 +108,14 @@ our $mimetypes_file = undef;\n>  # could be even 'utf-8' for the old behavior)\n>  our $fallback_encoding = 'latin1';\n>  \n> +# enable / disable a final link on the project list page\n> +# that will be the location of that actuall git url\n> +# it will output this in the format:\n> +# git://hostname/path/to/tree.git\n> +# disabled = blank or undef\n> +# enable = url to prefix before filling in the trailing path to the git repo\n> +our $projectlist_gitlinkurl = undef;\n> +\n>  # rename detection options for git-diff and git-diff-tree\n>  # - default is '-M', with the cost proportional to\n>  #   (number of removed files) * (number of new files).\n\nNote that I will soon submit a generic patch that lets you extend\nthe link lists with custom entries - you could easily use that for\nthe git links (I'm personally not convinced how useful they really are\non the project list page), I will use them for the graphiclog, edit and\nfork links at repo.or.cz.\n\n> +                        print \" | \". $cgi->a({-href => \"git://projectlist_gitlinkurl/\".esc_html($pr->{'path'})}, \"git\");\n\nYou meant $projectlist_gitlinkurl.\n\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe next generation of interesting software will be done\non the Macintosh, not the IBM PC.  -- Bill Gates\n"},{"id":"86140","messageId":"1217817517.32240.46.camel@localhost.localdomain","threadId":"14827","inReplyTo":"20080804022656.GA32184@machine.or.cz","subject":"Re: [PATCH 1/1] Add \"git\" link to the end of project line on the project_list page.","fromName":"J.H.","fromEmail":"warthog19@eaglescrag.net","sentAt":"2008-08-04T02:38:37Z","receivedAt":"2008-08-04T02:38:37Z","isPatch":true,"sender":{"key":"warthog19@eaglescrag.net","avatar":null},"body":"On Mon, 2008-08-04 at 04:26 +0200, Petr Baudis wrote:\n> On Sun, Aug 03, 2008 at 07:00:17PM -0700, warthog19@eaglescrag.net wrote:\n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index 90cd99b..c33f4ed 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -108,6 +108,14 @@ our $mimetypes_file = undef;\n> >  # could be even 'utf-8' for the old behavior)\n> >  our $fallback_encoding = 'latin1';\n> >  \n> > +# enable / disable a final link on the project list page\n> > +# that will be the location of that actuall git url\n> > +# it will output this in the format:\n> > +# git://hostname/path/to/tree.git\n> > +# disabled = blank or undef\n> > +# enable = url to prefix before filling in the trailing path to the git repo\n> > +our $projectlist_gitlinkurl = undef;\n> > +\n> >  # rename detection options for git-diff and git-diff-tree\n> >  # - default is '-M', with the cost proportional to\n> >  #   (number of removed files) * (number of new files).\n> \n> Note that I will soon submit a generic patch that lets you extend\n> the link lists with custom entries - you could easily use that for\n> the git links (I'm personally not convinced how useful they really are\n> on the project list page), I will use them for the graphiclog, edit and\n> fork links at repo.or.cz.\n\nI've found them useful, and there were requests out on the mailing list\nfor this to be added, thus the patching.  It's not on by default, so\nit's impact should be minimal unless people specifically want the link.\n\n> \n> > +                        print \" | \". $cgi->a({-href => \"git://projectlist_gitlinkurl/\".esc_html($pr->{'path'})}, \"git\");\n> \n> You meant $projectlist_gitlinkurl.\n\ngrrr - I've fixed that same bug twice now, had problems with something\nand must have reverted the wrong thing, I'll fix it and re-submit.\n\nWhen you do the more generic patch to extend the links I'll flip this\nover to that code, unless you think it's worth holding off and waiting\nfor that change to go in first?\n\n- John 'Warthog9' Hawley\n"},{"id":"86144","messageId":"20080804032044.GG10151@machine.or.cz","threadId":"14827","inReplyTo":"1217817517.32240.46.camel@localhost.localdomain","subject":"Re: [PATCH 1/1] Add \"git\" link to the end of project line on the project_list page.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-04T03:20:44Z","receivedAt":"2008-08-04T03:20:44Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Aug 03, 2008 at 07:38:37PM -0700, J.H. wrote:\n> On Mon, 2008-08-04 at 04:26 +0200, Petr Baudis wrote:\n> > On Sun, Aug 03, 2008 at 07:00:17PM -0700, warthog19@eaglescrag.net wrote:\n> > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > > index 90cd99b..c33f4ed 100755\n> > > --- a/gitweb/gitweb.perl\n> > > +++ b/gitweb/gitweb.perl\n> > > @@ -108,6 +108,14 @@ our $mimetypes_file = undef;\n> > >  # could be even 'utf-8' for the old behavior)\n> > >  our $fallback_encoding = 'latin1';\n> > >  \n> > > +# enable / disable a final link on the project list page\n> > > +# that will be the location of that actuall git url\n> > > +# it will output this in the format:\n> > > +# git://hostname/path/to/tree.git\n> > > +# disabled = blank or undef\n> > > +# enable = url to prefix before filling in the trailing path to the git repo\n> > > +our $projectlist_gitlinkurl = undef;\n> > > +\n> > >  # rename detection options for git-diff and git-diff-tree\n> > >  # - default is '-M', with the cost proportional to\n> > >  #   (number of removed files) * (number of new files).\n\nBy the way, you should add this to gitweb/README too (though I've never\nbeen too fond of listing the options twice myself; my strategy to avoid\nit is to just add as much stuff possible to the $features hash ;-).\n\n> > > +               if( $projectlist_gitlinkurl != undef && $projectlist_gitlinkurl ne \"\" ){\n\nCoding style conformant and equivalent but simpler variant would be\n\n\tif ($projectlist_gitlinkurl) {\n\nright?\n\n> > > +                        print \" | \". $cgi->a({-href => \"git://projectlist_gitlinkurl/\".esc_html($pr->{'path'})}, \"git\");\n> > \n> > You meant $projectlist_gitlinkurl.\n> \n> grrr - I've fixed that same bug twice now, had problems with something\n> and must have reverted the wrong thing, I'll fix it and re-submit.\n> \n> When you do the more generic patch to extend the links I'll flip this\n> over to that code, unless you think it's worth holding off and waiting\n> for that change to go in first?\n\nIt's a new feature so it probably won't make it to 1.6.0 - so let's see\nif I manage to submit mine before 1.6.0. ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe next generation of interesting software will be done\non the Macintosh, not the IBM PC.  -- Bill Gates\n"}]}