{"thread":{"id":"5421","subject":"[PATCH 5/5] gitweb: Add diff tree, with links to patches, to commitdiff view","startedAt":"2006-08-28T12:48:09Z","lastAt":"2006-08-30T09:47:12Z","messageCount":16,"participants":["Jakub Narebski","Linus Torvalds","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"26038","messageId":"11567692943154-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":null,"subject":"[PATCH 0/5] gitweb: Additions to commitdiff view","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:09Z","receivedAt":"2006-08-28T12:48:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This series of patches makes signoff lines to be not removed in commitdiff and log \nviews, adds author information to comittdiff view, and adds diff tree with links\nto patches in commitdiff view.\n\nYou will be able to see it at work at\n  http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi\n\nShortlog:\n---------\n1/5  gitweb: Make git_print_log generic; git_print_simplified_log uses it\n2/5  gitweb: Do not remove signoff lines in git_print_simplified_log\n3/5  gitweb: Add author information to commitdiff view\n4/5  gitweb: git_print_log: signoff line is non-empty line\n5/5  gitweb: Add diff tree, with links to patches, to commitdiff view\n\n-- \nJakub Narebski\nShadeHawk on #git\nPoland\n"},{"id":"26036","messageId":"11567692952496-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"[PATCH 1/5] gitweb: Make git_print_log generic; git_print_simplified_log uses it","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:10Z","receivedAt":"2006-08-28T12:48:10Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Collapse git_print_log and git_print_simplified_log into one\nsubroutine git_print_log.  git_print_simplified_log now simply calls\ngit_print_log with proper options.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   63 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 31 insertions(+), 32 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 59f1a87..e318f50 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1364,9 +1364,15 @@ sub git_print_page_path {\n \t}\n }\n \n-sub git_print_log {\n+# sub git_print_log (\\@;%) {\n+sub git_print_log ($;%) {\n \tmy $log = shift;\n+\tmy %opts = @_;\n \n+\tif ($opts{'-remove_title'}) {\n+\t\t# remove title, i.e. first line of log\n+\t\tshift @$log;\n+\t}\n \t# remove leading empty lines\n \twhile (defined $log->[0] && $log->[0] eq \"\") {\n \t\tshift @$log;\n@@ -1376,6 +1382,19 @@ sub git_print_log {\n \tmy $signoff = 0;\n \tmy $empty = 0;\n \tforeach my $line (@$log) {\n+\t\tif ($line =~ m/^ *(signed[ \\-]off[ \\-]by[ :]|acked[ \\-]by[ :]|cc[ :])/i) {\n+\t\t\t$signoff = 1;\n+\t\t\tif (! $opts{'-remove_signoff'}) {\n+\t\t\t\tprint \"<span class=\\\"signoff\\\">\" . esc_html($line) . \"</span><br/>\\n\";\n+\t\t\t\tnext;\n+\t\t\t} else {\n+\t\t\t\t# remove signoff lines\n+\t\t\t\tnext;\n+\t\t\t}\n+\t\t} else {\n+\t\t\t$signoff = 0;\n+\t\t}\n+\n \t\t# print only one empty line\n \t\t# do not print empty line after signoff\n \t\tif ($line eq \"\") {\n@@ -1384,13 +1403,13 @@ sub git_print_log {\n \t\t} else {\n \t\t\t$empty = 0;\n \t\t}\n-\t\tif ($line =~ m/^ *(signed[ \\-]off[ \\-]by[ :]|acked[ \\-]by[ :]|cc[ :])/i) {\n-\t\t\t$signoff = 1;\n-\t\t\tprint \"<span class=\\\"signoff\\\">\" . esc_html($line) . \"</span><br/>\\n\";\n-\t\t} else {\n-\t\t\t$signoff = 0;\n-\t\t\tprint format_log_line_html($line) . \"<br/>\\n\";\n-\t\t}\n+\n+\t\tprint format_log_line_html($line) . \"<br/>\\n\";\n+\t}\n+\n+\tif ($opts{'-final_empty_line'}) {\n+\t\t# end with single empty line\n+\t\tprint \"<br/>\\n\" unless $empty;\n \t}\n }\n \n@@ -1398,30 +1417,10 @@ sub git_print_simplified_log {\n \tmy $log = shift;\n \tmy $remove_title = shift;\n \n-\tshift @$log if $remove_title;\n-\t# remove leading empty lines\n-\twhile (defined $log->[0] && $log->[0] eq \"\") {\n-\t\tshift @$log;\n-\t}\n-\n-\t# simplify and print log\n-\tmy $empty = 0;\n-\tforeach my $line (@$log) {\n-\t\t# remove signoff lines\n-\t\tif ($line =~ m/^ *(signed[ \\-]off[ \\-]by[ :]|acked[ \\-]by[ :]|cc[ :])/i) {\n-\t\t\tnext;\n-\t\t}\n-\t\t# print only one empty line\n-\t\tif ($line eq \"\") {\n-\t\t\tnext if $empty;\n-\t\t\t$empty = 1;\n-\t\t} else {\n-\t\t\t$empty = 0;\n-\t\t}\n-\t\tprint format_log_line_html($line) . \"<br/>\\n\";\n-\t}\n-\t# end with single empty line\n-\tprint \"<br/>\\n\" unless $empty;\n+\tgit_print_log($log,\n+\t\t-final_empty_line=> 1,\n+\t\t-remove_signoff => 1,\n+\t\t-remove_title => $remove_title);\n }\n \n ## ......................................................................\n-- \n1.4.1.1\n"},{"id":"26037","messageId":"11567692953763-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"[PATCH 2/5] gitweb: Do not remove signoff lines in git_print_simplified_log","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:11Z","receivedAt":"2006-08-28T12:48:11Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Remove '-remove_signoff => 1' option to git_print_log call in the\ngit_print_simplified_log subroutine.  This means that in \"log\" and\n\"commitdiff\" views (git_log and git_commitdiff subroutines) signoff\nlines will be shown.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex e318f50..c2dcc6c 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1419,7 +1419,6 @@ sub git_print_simplified_log {\n \n \tgit_print_log($log,\n \t\t-final_empty_line=> 1,\n-\t\t-remove_signoff => 1,\n \t\t-remove_title => $remove_title);\n }\n \n-- \n1.4.1.1\n"},{"id":"26039","messageId":"11567692951542-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"[PATCH 3/5] gitweb: Add author information to commitdiff view","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:12Z","receivedAt":"2006-08-28T12:48:12Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add subroutine git_print_authorship to print author and date of\ncommit, div.author_date style to CSS, and use them in git_commitdiff.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.css  |    7 +++++++\n gitweb/gitweb.perl |   11 +++++++++++\n 2 files changed, 18 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.css b/gitweb/gitweb.css\nindex afd9e8a..eb9fc38 100644\n--- a/gitweb/gitweb.css\n+++ b/gitweb/gitweb.css\n@@ -116,6 +116,13 @@ div.list_head {\n \tfont-style: italic;\n }\n \n+div.author_date {\n+\tpadding: 8px;\n+\tborder: solid #d9d8d1;\n+\tborder-width: 0px 0px 1px 0px;\n+\tfont-style: italic;\n+}\n+\n a.list {\n \ttext-decoration: none;\n \tcolor: #000000;\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex c2dcc6c..81d3e76 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1341,6 +1341,16 @@ sub git_print_header_div {\n \t      \"\\n</div>\\n\";\n }\n \n+#sub git_print_authorship (\\%) {\n+sub git_print_authorship {\n+\tmy $co = shift;\n+\n+\tmy %ad = parse_date($co->{'author_epoch'});\n+\tprint \"<div class=\\\"author_date\\\">\" .\n+\t      esc_html($co->{'author_name'}) .\n+\t      \" [$ad{'rfc2822'}]</div>\\n\";\n+}\n+\n sub git_print_page_path {\n \tmy $name = shift;\n \tmy $type = shift;\n@@ -2914,6 +2924,7 @@ sub git_commitdiff {\n \t\tgit_header_html(undef, $expires);\n \t\tgit_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);\n \t\tgit_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);\n+\t\tgit_print_authorship(\\%co);\n \t\tprint \"<div class=\\\"page_body\\\">\\n\";\n \t\tprint \"<div class=\\\"log\\\">\\n\";\n \t\tgit_print_simplified_log($co{'comment'}, 1); # skip title\n-- \n1.4.1.1\n"},{"id":"26040","messageId":"11567692953331-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"[PATCH 4/5] gitweb: git_print_log: signoff line is non-empty line","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:13Z","receivedAt":"2006-08-28T12:48:13Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This correct minor error in git_print_log that didn't add final empty\nline when requested, if commit log ended with signoff.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 81d3e76..8987967 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1394,6 +1394,7 @@ sub git_print_log ($;%) {\n \tforeach my $line (@$log) {\n \t\tif ($line =~ m/^ *(signed[ \\-]off[ \\-]by[ :]|acked[ \\-]by[ :]|cc[ :])/i) {\n \t\t\t$signoff = 1;\n+\t\t\t$empty = 0;\n \t\t\tif (! $opts{'-remove_signoff'}) {\n \t\t\t\tprint \"<span class=\\\"signoff\\\">\" . esc_html($line) . \"</span><br/>\\n\";\n \t\t\t\tnext;\n-- \n1.4.1.1\n"},{"id":"26035","messageId":"11567692951193-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"[PATCH 5/5] gitweb: Add diff tree, with links to patches, to commitdiff view","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T12:48:14Z","receivedAt":"2006-08-28T12:48:14Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Added/uncommented git_difftree_body invocation in git_commitdiff.\nAdded anchors (via 'id' attribute) to patches in patchset.\ngit_difftree_body is modified to link to patch anchor when called from\ngit_commitdiff, instead of link to blobdiff.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   71 ++++++++++++++++++++++++++++++++++++----------------\n 1 files changed, 49 insertions(+), 22 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 8987967..ef09cf5 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1447,6 +1447,7 @@ sub git_difftree_body {\n \n \tprint \"<table class=\\\"diff_tree\\\">\\n\";\n \tmy $alternate = 0;\n+\tmy $patchno = 0;\n \tforeach my $line (@{$difftree}) {\n \t\tmy %diff = parse_difftree_raw_line($line);\n \n@@ -1487,8 +1488,14 @@ sub git_difftree_body {\n \t\t\t      \"<td class=\\\"link\\\">\" .\n \t\t\t      $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n \t\t\t                             hash_base=>$hash, file_name=>$diff{'file'})},\n-\t\t\t              \"blob\") .\n-\t\t\t      \"</td>\\n\";\n+\t\t\t              \"blob\");\n+\t\t\tif ($action == \"commitdiff\") {\n+\t\t\t\t# link to patch\n+\t\t\t\t$patchno++;\n+\t\t\t\tprint \" | \" .\n+\t\t\t\t      $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t}\n+\t\t\tprint \"</td>\\n\";\n \n \t\t} elsif ($diff{'status'} eq \"D\") { # deleted\n \t\t\tmy $mode_chng = \"<span class=\\\"file_status deleted\\\">[deleted $from_file_type]</span>\";\n@@ -1502,8 +1509,14 @@ sub git_difftree_body {\n \t\t\t      $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n \t\t\t                             hash_base=>$parent, file_name=>$diff{'file'})},\n \t\t\t              \"blob\") .\n-\t\t\t      \" | \" .\n-\t\t\t      $cgi->a({-href => href(action=>\"history\", hash_base=>$parent,\n+\t\t\t      \" | \";\n+\t\t\tif ($action == \"commitdiff\") {\n+\t\t\t\t# link to patch\n+\t\t\t\t$patchno++;\n+\t\t\t\tprint \" | \" .\n+\t\t\t\t      $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t}\n+\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$parent,\n \t\t\t                             file_name=>$diff{'file'})},\n \t\t\t              \"history\") .\n \t\t\t      \"</td>\\n\";\n@@ -1539,16 +1552,23 @@ sub git_difftree_body {\n \t\t\tprint \"</td>\\n\" .\n \t\t\t      \"<td>$mode_chnge</td>\\n\" .\n \t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t\t$cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n-\t\t\t\t                       hash_base=>$hash, file_name=>$diff{'file'})},\n-\t\t\t\t        \"blob\");\n+\t\t\t      $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n+\t\t\t                             hash_base=>$hash, file_name=>$diff{'file'})},\n+\t\t\t              \"blob\");\n \t\t\tif ($diff{'to_id'} ne $diff{'from_id'}) { # modified\n-\t\t\t\tprint \" | \" .\n-\t\t\t\t\t$cgi->a({-href => href(action=>\"blobdiff\",\n-\t\t\t\t\t                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n-\t\t\t\t\t                       hash_base=>$hash, hash_parent_base=>$parent,\n-\t\t\t\t\t                       file_name=>$diff{'file'})},\n-\t\t\t\t\t        \"diff\");\n+\t\t\t\tif ($action == \"commitdiff\") {\n+\t\t\t\t\t# link to patch\n+\t\t\t\t\t$patchno++;\n+\t\t\t\t\tprint \" | \" .\n+\t\t\t\t\t\t$cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t\t} else {\n+\t\t\t\t\tprint \" | \" .\n+\t\t\t\t\t\t$cgi->a({-href => href(action=>\"blobdiff\",\n+\t\t\t\t\t\t                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n+\t\t\t\t\t\t                       hash_base=>$hash, hash_parent_base=>$parent,\n+\t\t\t\t\t\t                       file_name=>$diff{'file'})},\n+\t\t\t\t\t\t        \"diff\");\n+\t\t\t\t}\n \t\t\t}\n \t\t\tprint \" | \" .\n \t\t\t\t$cgi->a({-href => href(action=>\"history\",\n@@ -1578,12 +1598,19 @@ sub git_difftree_body {\n \t\t\t                             hash=>$diff{'to_id'}, file_name=>$diff{'to_file'})},\n \t\t\t              \"blob\");\n \t\t\tif ($diff{'to_id'} ne $diff{'from_id'}) {\n-\t\t\t\tprint \" | \" .\n-\t\t\t\t\t$cgi->a({-href => href(action=>\"blobdiff\",\n-\t\t\t\t\t                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n-\t\t\t\t\t                       hash_base=>$hash, hash_parent_base=>$parent,\n-\t\t\t\t\t                       file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},\n-\t\t\t\t\t        \"diff\");\n+\t\t\t\tif ($action == \"commitdiff\") {\n+\t\t\t\t\t# link to patch\n+\t\t\t\t\t$patchno++;\n+\t\t\t\t\tprint \" | \" .\n+\t\t\t\t\t\t$cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t\t} else {\n+\t\t\t\t\tprint \" | \" .\n+\t\t\t\t\t\t$cgi->a({-href => href(action=>\"blobdiff\",\n+\t\t\t\t\t\t                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n+\t\t\t\t\t\t                       hash_base=>$hash, hash_parent_base=>$parent,\n+\t\t\t\t\t\t                       file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},\n+\t\t\t\t\t\t        \"diff\");\n+\t\t\t\t}\n \t\t\t}\n \t\t\tprint \"</td>\\n\";\n \n@@ -1616,7 +1643,7 @@ sub git_patchset_body {\n \t\t\t\t# first patch in patchset\n \t\t\t\t$patch_found = 1;\n \t\t\t}\n-\t\t\tprint \"<div class=\\\"patch\\\">\\n\";\n+\t\t\tprint \"<div class=\\\"patch\\\" id=\\\"patch\". ($patch_idx+1) .\"\\\">\\n\";\n \n \t\t\tif (ref($difftree->[$patch_idx]) eq \"HASH\") {\n \t\t\t\t$diffinfo = $difftree->[$patch_idx];\n@@ -2958,8 +2985,8 @@ TEXT\n \n \t# write patch\n \tif ($format eq 'html') {\n-\t\t#git_difftree_body(\\@difftree, $hash, $hash_parent);\n-\t\t#print \"<br/>\\n\";\n+\t\tgit_difftree_body(\\@difftree, $hash, $hash_parent);\n+\t\tprint \"<br/>\\n\";\n \n \t\tgit_patchset_body($fd, \\@difftree, $hash, $hash_parent);\n \t\tclose $fd;\n-- \n1.4.1.1\n"},{"id":"26055","messageId":"Pine.LNX.4.64.0608281016380.27779@g5.osdl.org","threadId":"5421","inReplyTo":"11567692943154-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH 0/5] gitweb: Additions to commitdiff view","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-08-28T17:26:18Z","receivedAt":"2006-08-28T17:26:18Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 28 Aug 2006, Jakub Narebski wrote:\n>\n> This series of patches makes signoff lines to be not removed in commitdiff and log \n> views, adds author information to comittdiff view, and adds diff tree with links\n> to patches in commitdiff view.\n> \n> You will be able to see it at work at\n>   http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi\n\nGoodie, that looks exactly like I envisioned. And the shortcuts to find \nthe patch to a specific file (when the patch is larger) works beautifully.\n\nNow I think \"commit-diff\" is prettier than the \"commit\" view (the latter \nends up showing the \"--pretty=full\" information, which can be useful, but \nusually is just distracting). That's as it should be - I consider \n\"commit-diff\" to be the _normal_ thing, and then the \"commit\" view is the \n\"give me all the ugly details in just the commit\".\n\nI've got _one_ small beef with gitweb still, which is that it seems to \nlike always showing things in UTC rather than the \"native\" timezone, but I \ncan see why people would sometimes want that. So I'm not actually sure \nit's wrong.\n\nI think it _may_ be worth showing the native timezone in the \"commit-diff\" \nview (when you see only one commit), and then show the UTC time in the \n\"log\" view (when you see a lot of commits, and might want to compare times \nin different timezones more easily).\n\nBut I think that timezone thing is probably a matter of taste rather than \nmuch anything else.\n\nThanks,\n\n\t\tLinus\n"},{"id":"26067","messageId":"11567998513000-git-send-email-jnareb@gmail.com","threadId":"5421","inReplyTo":"Pine.LNX.4.64.0608281016380.27779@g5.osdl.org","subject":"[PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-28T21:17:31Z","receivedAt":"2006-08-28T21:17:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Linus Torvalds wrote:\n> I've got _one_ small beef with gitweb still, which is that it seems to \n> like always showing things in UTC rather than the \"native\" timezone, but I \n> can see why people would sometimes want that. So I'm not actually sure \n> it's wrong.\n> \n> I think it _may_ be worth showing the native timezone in the \"commit-diff\" \n> view (when you see only one commit), and then show the UTC time in the \n> \"log\" view (when you see a lot of commits, and might want to compare times \n> in different timezones more easily).\n> \n> But I think that timezone thing is probably a matter of taste rather than \n> much anything else.\n\n-- >8 --\nAdd local time (hours and minutes) and local timezone to the output of\ngit_print_authorship command, used by git_commitdiff.  The code was\ntaken from git_commit subroutine.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   12 ++++++++++--\n 1 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex ef09cf5..fa7f62a 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1345,10 +1345,18 @@ #sub git_print_authorship (\\%) {\n sub git_print_authorship {\n \tmy $co = shift;\n \n-\tmy %ad = parse_date($co->{'author_epoch'});\n+\tmy %ad = parse_date($co->{'author_epoch'}, $co->{'author_tz'});\n \tprint \"<div class=\\\"author_date\\\">\" .\n \t      esc_html($co->{'author_name'}) .\n-\t      \" [$ad{'rfc2822'}]</div>\\n\";\n+\t      \" [$ad{'rfc2822'}\";\n+\tif ($ad{'hour_local'} < 6) {\n+\t\tprintf(\" (<span class=\\\"atnight\\\">%02d:%02d</span> %s)\",\n+\t\t       $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});\n+\t} else {\n+\t\tprintf(\" (%02d:%02d %s)\",\n+\t\t       $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});\n+\t}\n+\tprint \"]</div>\\n\";\n }\n \n sub git_print_page_path {\n-- \n1.4.1.1\n"},{"id":"26073","messageId":"7vveocpfa3.fsf@assigned-by-dhcp.cox.net","threadId":"5421","inReplyTo":"11567998513000-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-29T00:16:36Z","receivedAt":"2006-08-29T00:16:36Z","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> Add local time (hours and minutes) and local timezone to the output of\n> git_print_authorship command, used by git_commitdiff.\n\nLooks nice, thanks.\n\nNow I got envious seeing people are having SO MUCH FUN with\ngitweb, so here is mine...\n\nLikes, dislikes, \"your color selection sucks ;-)\",... ?\n\n-- >8 --\ngitweb: show age and author in blame output\n\nThis does two things.\n\n - The commit object name link on each link uses \"title\", which\n   shows the author and age of the particular line when hovered\n   over.\n\n - The background of these links are painted on darker color as\n   they become older and the links on younger lines are shown on\n   lighter background.\n\n---\ndiff --git a/gitweb/gitweb.css b/gitweb/gitweb.css\nindex eb9fc38..008ee70 100644\n--- a/gitweb/gitweb.css\n+++ b/gitweb/gitweb.css\n@@ -215,6 +215,12 @@ td.sha1 {\n \tfont-family: monospace;\n }\n \n+td.age-week   { color: #00f; background-color: #fff; }\n+td.age-month  { color: #00f; background-color: #eef; }\n+td.age-season { color: #00f; background-color: #ddf; }\n+td.age-year   { color: #00f; background-color: #ccf; }\n+td.age-old    { color: #00f; background-color: #bbf; }\n+\n td.error {\n \tcolor: red;\n \tbackground-color: yellow;\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 9324d71..7dbd40f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2190,7 +2190,7 @@ sub git_blame2 {\n \tif ($ftype !~ \"blob\") {\n \t\tdie_error(\"400 Bad Request\", \"Object is not a blob\");\n \t}\n-\topen ($fd, \"-|\", git_cmd(), \"blame\", '-l', $file_name, $hash_base)\n+\topen ($fd, \"-|\", git_cmd(), \"blame\", '-l', '-t', $file_name, $hash_base)\n \t\tor die_error(undef, \"Open git-blame failed\");\n \tgit_header_html();\n \tmy $formats_nav =\n@@ -2211,12 +2211,21 @@ sub git_blame2 {\n <table class=\"blame\">\n <tr><th>Commit</th><th>Line</th><th>Data</th></tr>\n HTML\n+\tmy $now = time();\n \twhile (<$fd>) {\n-\t\t/^([0-9a-fA-F]{40}).*?(\\d+)\\)\\s{1}(\\s*.*)/;\n-\t\tmy $full_rev = $1;\n+\t\tmy ($full_rev, $author, $timestamp, $zone, $lineno, $data) =\n+\t\t    /^([0-9a-fA-F]{40})\\s\\((.*?)\\s+(\\d+)\\s\n+\t\t    ([-+\\d]{5})\\s+(\\d+)\\)\\s{1}(\\s*.*)/x;\n \t\tmy $rev = substr($full_rev, 0, 8);\n-\t\tmy $lineno = $2;\n-\t\tmy $data = $3;\n+\n+\t\tmy $age = $now - $timestamp;\n+\t\tmy $ago = age_string($age);\n+\t\tmy $pop = \"$author, $ago\";\n+\t\tmy $agegroup =\n+\t\t    (($age < 60*60*24*7) ? \"age-week\" :\n+\t\t     ($age < 60*60*24*30) ? \"age-month\" :\n+\t\t     ($age < 60*60*24*120) ? \"age-season\" :\n+\t\t     ($age < 60*60*24*360) ? \"age-year\" : \"age-old\");\n \n \t\tif (!defined $last_rev) {\n \t\t\t$last_rev = $full_rev;\n@@ -2225,7 +2234,8 @@ HTML\n \t\t\t$current_color = ++$current_color % $num_colors;\n \t\t}\n \t\tprint \"<tr class=\\\"$rev_color[$current_color]\\\">\\n\";\n-\t\tprint \"<td class=\\\"sha1\\\">\" .\n+\t\tprint \"<td class=\\\"sha1 $agegroup\\\" title=\\\"\" .\n+\t\t\tesc_html($pop) .\"\\\">\" .\n \t\t\t$cgi->a({-href => href(action=>\"commit\", hash=>$full_rev, file_name=>$file_name)},\n \t\t\t        esc_html($rev)) . \"</td>\\n\";\n \t\tprint \"<td class=\\\"linenr\\\"><a id=\\\"l$lineno\\\" href=\\\"#l$lineno\\\" class=\\\"linenr\\\">\" .\n"},{"id":"26078","messageId":"ed0ths$okn$1@sea.gmane.org","threadId":"5421","inReplyTo":"7vveocpfa3.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-29T08:23:39Z","receivedAt":"2006-08-29T08:23:39Z","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>> Add local time (hours and minutes) and local timezone to the output of\n>> git_print_authorship command, used by git_commitdiff.\n> \n> Looks nice, thanks.\n> \n> Now I got envious seeing people are having SO MUCH FUN with\n> gitweb, so here is mine...\n> \n> Likes, dislikes, \"your color selection sucks ;-)\",... ?\n> \n> -- >8 --\n\n> +td.age-week   { color: #00f; background-color: #fff; }\n> +td.age-month  { color: #00f; background-color: #eef; }\n> +td.age-season { color: #00f; background-color: #ddf; }\n> +td.age-year   { color: #00f; background-color: #ccf; }\n> +td.age-old    { color: #00f; background-color: #bbf; }\n\nCould you use full hex color length? Everywhere else in CSS we use \n6-char wide hex colours.\n\n> +     my $now = time();\n>       while (<$fd>) {\n> -             /^([0-9a-fA-F]{40}).*?(\\d+)\\)\\s{1}(\\s*.*)/;\n> -             my $full_rev = $1;\n> +             my ($full_rev, $author, $timestamp, $zone, $lineno, $data) =\n> +                 /^([0-9a-fA-F]{40})\\s\\((.*?)\\s+(\\d+)\\s\n> +                 ([-+\\d]{5})\\s+(\\d+)\\)\\s{1}(\\s*.*)/x;\n\nNice compact style. But different from other parsing using regexp in gitweb.\nAnd some of those other, e.g. parse_difftree_raw_line cannot use this style.\nDoesn't matter much.\n\n>               my $rev = substr($full_rev, 0, 8);\n> -             my $lineno = $2;\n> -             my $data = $3;\n> +\n> +             my $age = $now - $timestamp;\n> +             my $ago = age_string($age);\n> +             my $pop = \"$author, $ago\";\n> +             my $agegroup =\n> +                 (($age < 60*60*24*7) ? \"age-week\" :\n> +                  ($age < 60*60*24*30) ? \"age-month\" :\n> +                  ($age < 60*60*24*120) ? \"age-season\" :\n> +                  ($age < 60*60*24*360) ? \"age-year\" : \"age-old\");\n\nWe have age_class subroutine which does something similar.\nI'm not sure if one subroutine can be used for those two situations.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"26079","messageId":"7vu03voqss.fsf@assigned-by-dhcp.cox.net","threadId":"5421","inReplyTo":"ed0ths$okn$1@sea.gmane.org","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-29T09:05:23Z","receivedAt":"2006-08-29T09:05:23Z","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> Could you use full hex color length? Everywhere else in CSS we use \n> 6-char wide hex colours.\n\nWill do for consistency's sake, although I do not think we\nreally care about the extra precision in this application.\n\n> We have age_class subroutine which does something similar.\n\nYeah, but...\n\n (1) When somebody says \"there are three age classes: age0,\n     age1, and age2\", can you tell which one represents older\n     ones?  I think they are misnamed.\n\n (2) The classification of age_class seems to be useful for the\n     project age, which is to check if anything happened in the\n     last two hours and last two days.  Unless the project is\n     really dead/dormant it should not be more than a month.  On\n     the other hand, a mature and stable project should have\n     more than 80% lines that are more than a year old, even if\n     it is very active and have many lines that are less than\n     two hours old.\n\n     The yardstick age_class uses is really geared toward\n     checking project's last activity and not appropriate for\n     use in blame.  Luckily, blame2 does not use it.\n\n (3) I'd like to eventually get rid of the abbreviated commit\n     object name from blame output, so the setting in gitweb.css\n     for table.blame td.age[012] (different colors and font\n     styles) is not appropriate for what I am shooting at.\n\nI have a bit updated 3-series for review.\n"},{"id":"26080","messageId":"7vhczvoqrj.fsf_-_@assigned-by-dhcp.cox.net","threadId":"5421","inReplyTo":"7vveocpfa3.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] gitweb: split output routine of blame2","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-29T09:06:08Z","receivedAt":"2006-08-29T09:06:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Make the loop over blame output to collect lines belonging to the\nsame revision, and send it over to the output routine \"flush_blame_lines\".\nThis will let me do interesting things later.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n gitweb/gitweb.perl |   73 +++++++++++++++++++++++++++++++++++++---------------\n 1 files changed, 52 insertions(+), 21 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 555441d..28e1cfd 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2170,6 +2170,33 @@ sub git_tag {\n \tgit_footer_html();\n }\n \n+sub flush_blame_lines {\n+\tmy ($color, $file_name, @line) = @_;\n+\tmy $full_rev = shift @line;\n+\tmy $rev = substr($full_rev, 0, 8);\n+\n+\tfor (@line) {\n+\t\tunless (/^[0-9a-fA-F]{40}.*?(\\d+)\\)\\s(.*)/) {\n+\t\t\tprint \"<tr><td>(malformed blame output)</td></tr>\";\n+\t\t\tnext;\n+\t\t}\n+\t\tmy $lineno = $1;\n+\t\tmy $data = $2;\n+\t\tprint \"<tr class=\\\"$color\\\">\\n\";\n+\t\tprint \"<td class=\\\"sha1\\\">\" .\n+\t\t$cgi->a({-href => href(action=>\"commit\",\n+\t\t\t\t       hash=>$full_rev,\n+\t\t\t\t       file_name=>$file_name)},\n+\t\t\tesc_html($rev)) . \"</td>\\n\";\n+\t\tprint +(\"<td class=\\\"linenr\\\">\".\n+\t\t\t\"<a id=\\\"l$lineno\\\" href=\\\"#l$lineno\\\" \".\n+\t\t\t\"class=\\\"linenr\\\">\" .\n+\t\t\tesc_html($lineno) . \"</a></td>\\n\");\n+\t\tprint \"<td class=\\\"pre\\\">\" . esc_html($data) . \"</td>\\n\";\n+\t\tprint \"</tr>\\n\";\n+\t}\n+}\n+\n sub git_blame2 {\n \tmy $fd;\n \tmy $ftype;\n@@ -2205,33 +2232,37 @@ sub git_blame2 {\n \tmy @rev_color = (qw(light2 dark2));\n \tmy $num_colors = scalar(@rev_color);\n \tmy $current_color = 0;\n-\tmy $last_rev;\n+\tmy @current_group = ();\n \tprint <<HTML;\n <div class=\"page_body\">\n <table class=\"blame\">\n <tr><th>Commit</th><th>Line</th><th>Data</th></tr>\n HTML\n \twhile (<$fd>) {\n-\t\t/^([0-9a-fA-F]{40}).*?(\\d+)\\)\\s{1}(\\s*.*)/;\n-\t\tmy $full_rev = $1;\n-\t\tmy $rev = substr($full_rev, 0, 8);\n-\t\tmy $lineno = $2;\n-\t\tmy $data = $3;\n-\n-\t\tif (!defined $last_rev) {\n-\t\t\t$last_rev = $full_rev;\n-\t\t} elsif ($last_rev ne $full_rev) {\n-\t\t\t$last_rev = $full_rev;\n-\t\t\t$current_color = ++$current_color % $num_colors;\n-\t\t}\n-\t\tprint \"<tr class=\\\"$rev_color[$current_color]\\\">\\n\";\n-\t\tprint \"<td class=\\\"sha1\\\">\" .\n-\t\t\t$cgi->a({-href => href(action=>\"commit\", hash=>$full_rev, file_name=>$file_name)},\n-\t\t\t        esc_html($rev)) . \"</td>\\n\";\n-\t\tprint \"<td class=\\\"linenr\\\"><a id=\\\"l$lineno\\\" href=\\\"#l$lineno\\\" class=\\\"linenr\\\">\" .\n-\t\t      esc_html($lineno) . \"</a></td>\\n\";\n-\t\tprint \"<td class=\\\"pre\\\">\" . esc_html($data) . \"</td>\\n\";\n-\t\tprint \"</tr>\\n\";\n+\t\tmy $full_rev;\n+\t\tunless (($full_rev) = /^([0-9a-fA-F]{40})/) {\n+\t\t\tprint \"<tr><td>(malformed blame output)</td></tr>\\n\";\n+\t\t\tnext;\n+\t\t}\n+\t\tif (@current_group) {\n+\t\t\tif (($current_group[0] ne $full_rev)) {\n+\t\t\t\t$current_color = ++$current_color % $num_colors;\n+\t\t\t\tflush_blame_lines($rev_color[$current_color],\n+\t\t\t\t\t\t  $file_name,\n+\t\t\t\t\t\t  @current_group);\n+\t\t\t}\n+\t\t\telse {\n+\t\t\t\tpush @current_group, $_;\n+\t\t\t\tnext;\n+\t\t\t}\n+\t\t}\n+\t\t@current_group = ($full_rev, $_);\n+\t}\n+\tif (@current_group) {\n+\t\t$current_color = ++$current_color % $num_colors;\n+\t\tflush_blame_lines($rev_color[$current_color],\n+\t\t\t\t  $file_name,\n+\t\t\t\t  @current_group);\n \t}\n \tprint \"</table>\\n\";\n \tprint \"</div>\";\n-- \n1.4.2.g39ee\n"},{"id":"26081","messageId":"7vbqq3oqqq.fsf_-_@assigned-by-dhcp.cox.net","threadId":"5421","inReplyTo":"7vveocpfa3.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] gitweb: show rev only on the first line of each group in blame","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-29T09:06:37Z","receivedAt":"2006-08-29T09:06:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks to the last round, this is now easy to do.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n gitweb/gitweb.perl |   21 ++++++++++++++++-----\n 1 files changed, 16 insertions(+), 5 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 28e1cfd..5c82d3f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2174,8 +2174,11 @@ sub flush_blame_lines {\n \tmy ($color, $file_name, @line) = @_;\n \tmy $full_rev = shift @line;\n \tmy $rev = substr($full_rev, 0, 8);\n+\tmy $cnt = scalar @line;\n+\tmy $this = 0;\n \n \tfor (@line) {\n+\t\t$this++;\n \t\tunless (/^[0-9a-fA-F]{40}.*?(\\d+)\\)\\s(.*)/) {\n \t\t\tprint \"<tr><td>(malformed blame output)</td></tr>\";\n \t\t\tnext;\n@@ -2183,11 +2186,19 @@ sub flush_blame_lines {\n \t\tmy $lineno = $1;\n \t\tmy $data = $2;\n \t\tprint \"<tr class=\\\"$color\\\">\\n\";\n-\t\tprint \"<td class=\\\"sha1\\\">\" .\n-\t\t$cgi->a({-href => href(action=>\"commit\",\n-\t\t\t\t       hash=>$full_rev,\n-\t\t\t\t       file_name=>$file_name)},\n-\t\t\tesc_html($rev)) . \"</td>\\n\";\n+\n+\t\tif ($this == 1) {\n+\t\t\tif (1 < $cnt) {\n+\t\t\t\tprint \"<td class=\\\"sha1\\\" rowspan=\\\"$cnt\\\">\";\n+\t\t\t}\n+\t\t\telse {\n+\t\t\t\tprint \"<td class=\\\"sha1\\\">\";\n+\t\t\t}\n+\t\t\tprint $cgi->a({-href => href(action=>\"commit\",\n+\t\t\t\t\t\t     hash=>$full_rev,\n+\t\t\t\t\t\t     file_name=>$file_name)},\n+\t\t\t\t      esc_html($rev)) . \"</td>\\n\";\n+\t\t}\n \t\tprint +(\"<td class=\\\"linenr\\\">\".\n \t\t\t\"<a id=\\\"l$lineno\\\" href=\\\"#l$lineno\\\" \".\n \t\t\t\"class=\\\"linenr\\\">\" .\n-- \n1.4.2.g39ee\n"},{"id":"26085","messageId":"ed142v$fbi$1@sea.gmane.org","threadId":"5421","inReplyTo":"7vu03voqss.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-29T10:15:10Z","receivedAt":"2006-08-29T10:15:10Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n>  (3) I'd like to eventually get rid of the abbreviated commit\n>      object name from blame output, so the setting in gitweb.css\n>      for table.blame td.age[012] (different colors and font\n>      styles) is not appropriate for what I am shooting at.\n\nWhat do you want to replace it with? Link can be to \"commit\" or \"commitdiff\"\nview, but some marker for commit (perhaps 'git-name-rev --tags'?) is\nneeded.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"26107","messageId":"7vlkp6kfwh.fsf@assigned-by-dhcp.cox.net","threadId":"5421","inReplyTo":"ed142v$fbi$1@sea.gmane.org","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-30T04:26:38Z","receivedAt":"2006-08-30T04:26:38Z","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> Junio C Hamano wrote:\n>\n>>  (3) I'd like to eventually get rid of the abbreviated commit\n>>      object name from blame output, so the setting in gitweb.css\n>>      for table.blame td.age[012] (different colors and font\n>>      styles) is not appropriate for what I am shooting at.\n>\n> What do you want to replace it with? Link can be to \"commit\" or \"commitdiff\"\n> view, but some marker for commit (perhaps 'git-name-rev --tags'?) is\n> needed.\n\nI was hoping I can get away with a narrow single column of solid\ncolor that says nothing.  8 hexadecimal digits do not mean much\nto humans and it is taking 8-column or so of screen real estate\nthat could otherwise be used to show the source lines instead.\n\nI've tried doing that (just set $rev to a single space, and make\nthe \"Commit\" column narrower in sub blame2 {}).  One drawback is\nthat while 8 hexadecimal digits do not mean anything they do\nhelp to match lines that came from the same rev (i.e. \"I do not\nknow what this 8fad7343 mean but this group of lines and that\ngroup are tagged together with that same 8fad7343 so they must\ncome from the same revision\").\n"},{"id":"26109","messageId":"ed3mqc$n6k$1@sea.gmane.org","threadId":"5421","inReplyTo":"7vlkp6kfwh.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Add local time and timezone to git_print_authorship","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-30T09:47:12Z","receivedAt":"2006-08-30T09:47:12Z","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>> Junio C Hamano wrote:\n>>\n>>>  (3) I'd like to eventually get rid of the abbreviated commit\n>>>      object name from blame output, so the setting in gitweb.css\n>>>      for table.blame td.age[012] (different colors and font\n>>>      styles) is not appropriate for what I am shooting at.\n>>\n>> What do you want to replace it with? Link can be to \"commit\" \n>> or \"commitdiff\" view, but some marker for commit \n>> (perhaps 'git-name-rev --tags'?) is needed.\n> \n> I was hoping I can get away with a narrow single column of solid\n> color that says nothing.  8 hexadecimal digits do not mean much\n> to humans and it is taking 8-column or so of screen real estate\n> that could otherwise be used to show the source lines instead.\n\nI don't think that is much an issue. Source code is usually (read:\nshould be) 80-columns wide, and with default font size there is\ncertainly place for 8-column revision number. Anything more, and\nmuch more (like e.g. default git_blame a.k.a. git_annotate output)\nand it is less readable.\n\n> I've tried doing that (just set $rev to a single space, and make\n> the \"Commit\" column narrower in sub blame2 {}).  One drawback is\n> that while 8 hexadecimal digits do not mean anything they do\n> help to match lines that came from the same rev (i.e. \"I do not\n> know what this 8fad7343 mean but this group of lines and that\n> group are tagged together with that same 8fad7343 so they must\n> come from the same revision\").\n\nSo what you need is to solve graph coloring problem (which is not\nmap coloring, as the same revisions needs the same color) for \nrevisions ;-) \n\nI have an idea to use first character of commit hash together with\ndark/light (odd/even) class to color blocks of lines in the same \nrevisions, 16 colors (we could reduce it to e.g. 6 or 8 colors)\nwith darker/lighter version.\n\nThe problem is to reduce hash to 16 or 8 bits with as small number of\ncollisions as possible (in average).\n\n\nYet another blame improvement idea would be to \"highlight\" whole _block_\non hover (on mouseover), but it needs changing blame output format from\ntable to divs (like \"blob\" view). BTW. table view should be I think\nreserved for tabular data, i.e. when sorting by at least some of columns\nhave sense.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}