{"thread":{"id":"4585","subject":"[PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","startedAt":"2006-06-20T08:12:31Z","lastAt":"2006-06-20T15:28:35Z","messageCount":7,"participants":["Jakub Narebski","Junio C Hamano","Timo Hirvonen","David Woodhouse"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22116","messageId":"200606201012.31684.jnareb@gmail.com","threadId":"4585","inReplyTo":null,"subject":"[PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T08:12:31Z","receivedAt":"2006-06-20T08:12:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This allows to see full, unshortened value on mouseover using 'title'\nattribute for <td> element. For now it means only author name and\nproject owner name.\n\nUgly solution using $cgi->start_td({-title => VALUE})\n\nDoesn't work well with values outside us-ascii, but that might be\nconsidered web browser bug (misfeature), not a bug in gitweb.\n\n---\nThe idea is to have full value available on mouseover, be it commit title, \nauthor of the commit, project owner, tag name/title or project description.\nFor now only author name and project owner name are implemented, and\nimplementation is ugly and results is not perfect.\n\n\n gitweb/gitweb.cgi |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\nb72280ac4649d54375732de771f7d92c7d350258\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 1b254df..9a09b20 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -887,7 +887,7 @@ sub git_project_list {\n \t\t$alternate ^= 1;\n \t\tprint \"<td>\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$pr->{'path'};a=summary\"), -class => \"list\"}, esc_html($pr->{'path'})) . \"</td>\\n\" .\n \t\t      \"<td>$pr->{'descr'}</td>\\n\" .\n-\t\t      \"<td><i>\" . chop_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n+\t\t      $cgi->start_td({-title => $pr->{'owner'}}) . chop_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n \t\tmy $colored_age;\n \t\tif ($pr->{'commit'}{'age'} < 60*60*2) {\n \t\t\t$colored_age = \"<span style =\\\"color: #009900;\\\"><b><i>$pr->{'commit'}{'age_string'}</i></b></span>\";\n@@ -1057,7 +1057,7 @@ sub git_summary {\n \t\t\t\t$ref = \" <span class=\\\"tag\\\">\" . esc_html($refs->{$commit}) . \"</span>\";\n \t\t\t}\n \t\t\tprint \"<td><i>$co{'age_string'}</i></td>\\n\" .\n-\t\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 10)) . \"</i></td>\\n\" .\n+\t\t\t      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . \"</i></td>\\n\" .\n \t\t\t      \"<td>\";\n \t\t\tif (length($co{'title_short'}) < length($co{'title'})) {\n \t\t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\"), -class => \"list\", -title => \"$co{'title'}\"},\n@@ -2306,7 +2306,7 @@ sub git_history {\n \t\t\t}\n \t\t\t$alternate ^= 1;\n \t\t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 3)) . \"</i></td>\\n\" .\n+\t\t\t      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 3)) . \"</i></td>\\n\" .\n \t\t\t      \"<td>\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\"), -class => \"list\"}, \"<b>\" .\n \t\t\t      esc_html(chop_str($co{'title'}, 50)) . \"$ref</b>\") . \"</td>\\n\" .\n \t\t\t      \"<td class=\\\"link\\\">\" .\n@@ -2396,7 +2396,7 @@ sub git_search {\n \t\t\t}\n \t\t\t$alternate ^= 1;\n \t\t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n+\t\t\t      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n \t\t\t      \"<td>\" .\n \t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$co{'id'}\"), -class => \"list\"}, \"<b>\" . esc_html(chop_str($co{'title'}, 50)) . \"</b><br/>\");\n \t\t\tmy $comment = $co{'comment'};\n@@ -2449,7 +2449,7 @@ sub git_search {\n \t\t\t\t\t}\n \t\t\t\t\t$alternate ^= 1;\n \t\t\t\t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t\t\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n+\t\t\t\t\t      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . \"</i></td>\\n\" .\n \t\t\t\t\t      \"<td>\" .\n \t\t\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$co{'id'}\"), -class => \"list\"}, \"<b>\" .\n \t\t\t\t\t      esc_html(chop_str($co{'title'}, 50)) . \"</b><br/>\");\n@@ -2537,7 +2537,7 @@ sub git_shortlog {\n \t\t}\n \t\t$alternate ^= 1;\n \t\tprint \"<td title=\\\"$co{'age_string_age'}\\\"><i>$co{'age_string_date'}</i></td>\\n\" .\n-\t\t      \"<td><i>\" . esc_html(chop_str($co{'author_name'}, 10)) . \"</i></td>\\n\" .\n+\t\t      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . \"</i></td>\\n\" .\n \t\t      \"<td>\";\n \t\tif (length($co{'title_short'}) < length($co{'title'})) {\n \t\t\tprint $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\"), -class => \"list\", -title => \"$co{'title'}\"},\n-- \n1.3.0\n"},{"id":"22120","messageId":"7vd5d4chmg.fsf@assigned-by-dhcp.cox.net","threadId":"4585","inReplyTo":"200606201012.31684.jnareb@gmail.com","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-20T09:15:51Z","receivedAt":"2006-06-20T09:15:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Doesn't work well with values outside us-ascii, but that might be\n> considered web browser bug (misfeature), not a bug in gitweb.\n\nThat's sad.\n\nAre you sure about it?\n\nWhat does start_td({-title=>\"blah\"}) produce? <td title=\"blah\">?\nIf so, is http://members.cox.net/junkio/t.html close to what you\nare trying to achieve here?\n\n>  \t\t      \"<td>$pr->{'descr'}</td>\\n\" .\n> -\t\t      \"<td><i>\" . chop_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n> +\t\t      $cgi->start_td({-title => $pr->{'owner'}}) . chop_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n\nWhere did the opening <i> go?  Not that I care about italics,\nsince I think this should all be done with stylesheet, but I do\ncare about unbalanced pairs.\n\nBTW, I haven't nailed down the procedure to update the\nkernel.org gitweb installations (I suspect the burden is on me\nsince Kay orphaned gitweb onto me).\n\nI wonder if there is somebody who is willing to run gitweb from\nthe \"next\" branch on some public site, so that I can be\nreasonably confident before breaking one of the most important\ninfrastructure of the kernel development?  Volunteers?\n"},{"id":"22123","messageId":"20060620124606.4e3e226c.tihirvon@gmail.com","threadId":"4585","inReplyTo":"7vd5d4chmg.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-06-20T09:46:06Z","receivedAt":"2006-06-20T09:46:06Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n\n> I wonder if there is somebody who is willing to run gitweb from\n> the \"next\" branch on some public site, so that I can be\n> reasonably confident before breaking one of the most important\n> infrastructure of the kernel development?  Volunteers?\n\nI can help.\n\nhttp://onion.dynserv.net/git/gitweb.cgi\n\nNote: http://onion.dynserv.net/git/ (index.cgi) is an old version.\n\nGlobal symbol \"$path\" requires explicit package name at\n/var/www/localhost/htdocs/git/gitweb.cgi line 1521.\nExecution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to\ncompilation errors.\n\nThe line is:\n\n$file =~ m#^/# or $file = \"$projectroot/$path/$file\";\n\n$path seems to be undefined.  I don't understand perl very well so I\ncan't fix it.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"22124","messageId":"e78g90$40u$1@sea.gmane.org","threadId":"4585","inReplyTo":"7vd5d4chmg.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T09:48:19Z","receivedAt":"2006-06-20T09:48:19Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n>> Doesn't work well with values outside us-ascii, but that might be\n>> considered web browser bug (misfeature), not a bug in gitweb.\n> \n> That's sad.\n> \n> Are you sure about it?\n\nNow I see I was wrong.\n\n> What does start_td({-title=>\"blah\"}) produce? <td title=\"blah\">?\n> If so, is http://members.cox.net/junkio/t.html close to what you\n> are trying to achieve here?\n\nYes, that is what I tried to achieve. Using CGI to set attributes\nwas to quote characters which cannot be in double quited attribute values,\ni.e. change '\"' to '&#34;' or '&quot;'. I don't know what start_td did with\n\\\"o character (Perl v5.8.6, CGI::VERSION=3.05).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22126","messageId":"e78gun$65s$1@sea.gmane.org","threadId":"4585","inReplyTo":"20060620124606.4e3e226c.tihirvon@gmail.com","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-06-20T09:59:55Z","receivedAt":"2006-06-20T09:59:55Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Timo Hirvonen wrote:\n\n> http://onion.dynserv.net/git/gitweb.cgi\n> \n> Global symbol \"$path\" requires explicit package name at\n> /var/www/localhost/htdocs/git/gitweb.cgi line 1521.\n> Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to\n> compilation errors.\n> \n> The line is:\n> \n> $file =~ m#^/# or $file = \"$projectroot/$path/$file\";\n> \n> $path seems to be undefined.  I don't understand perl very well so I\n> can't fix it.\n\nTemporary fix is in:\n \n  \"[PATCH] Fix: Support for the standard mime.types map in gitweb\"\n  (Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)\n    http://permalink.gmane.org/gmane.comp.version-control.git/22172\n\nBTW. I have _my_ version at \n  http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"22127","messageId":"20060620135750.7880c62d.tihirvon@gmail.com","threadId":"4585","inReplyTo":"e78gun$65s$1@sea.gmane.org","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2006-06-20T10:57:50Z","receivedAt":"2006-06-20T10:57:50Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Jakub Narebski <jnareb@gmail.com> wrote:\n\n> Timo Hirvonen wrote:\n> \n> > http://onion.dynserv.net/git/gitweb.cgi\n> > \n> > Global symbol \"$path\" requires explicit package name at\n> > /var/www/localhost/htdocs/git/gitweb.cgi line 1521.\n> > Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to\n> > compilation errors.\n> > \n> > The line is:\n> > \n> > $file =~ m#^/# or $file = \"$projectroot/$path/$file\";\n> > \n> > $path seems to be undefined.  I don't understand perl very well so I\n> > can't fix it.\n> \n> Temporary fix is in:\n>  \n>   \"[PATCH] Fix: Support for the standard mime.types map in gitweb\"\n>   (Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)\n>     http://permalink.gmane.org/gmane.comp.version-control.git/22172\n\nSeems to work now.  I also enabled blame and it works too. But I noticed\nthat the search is sometimes broken.  If you click a \"blob\" link and\nthen try to search something gitweb will complain:\n\n    403 Forbidden - Unknown commit object. \n\n\"h\" parameter is blob, not commit. Shouldn't the h parameter be set to\nHEAD always when searching?  Searching starts at h so the search results\nvary:\n\nhttp://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=HEAD&s=pickaxe%3Atheme\n\nhttp://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=fd2d983d51858e25cc71b14b59c787e1683ba7c5&s=pickaxe%3Atheme\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"22145","messageId":"1150817316.17609.77.camel@hades.cambridge.redhat.com","threadId":"4585","inReplyTo":"7vd5d4chmg.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells","fromName":"David Woodhouse","fromEmail":"dwmw2@infradead.org","sentAt":"2006-06-20T15:28:35Z","receivedAt":"2006-06-20T15:28:35Z","isPatch":true,"sender":{"key":"dwmw2@infradead.org","avatar":"https://gravatar.com/avatar/7afd4f07e0cf7d7e046ae2d23678296b37777c96488e6f3451e78a5514154ebd?d=mp&s=160"},"body":"On Tue, 2006-06-20 at 02:15 -0700, Junio C Hamano wrote:\n> I wonder if there is somebody who is willing to run gitweb from\n> the \"next\" branch on some public site, so that I can be\n> reasonably confident before breaking one of the most important\n> infrastructure of the kernel development?  Volunteers? \n\nYeah, we can do it on git.infradead.org if you promise to respond\nquickly when you break it. Or I can set up a virtual host on\nhttp://git2.infradead.org/ to use the testing version if you'd prefer.\n\nMail me a SSH public key, I'll give you an account.\n\n-- \ndwmw2\n"}]}