{"thread":{"id":"5385","subject":"[PATCH/RFC] gitweb: Restore old git_blame using git-annotate under \"annotate\"","startedAt":"2006-08-25T23:47:09Z","lastAt":"2006-08-26T00:13:05Z","messageCount":2,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25908","messageId":"200608260147.10880.jnareb@gmail.com","threadId":"5385","inReplyTo":null,"subject":"[PATCH/RFC] gitweb: Restore old git_blame using git-annotate under \"annotate\"","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-25T23:47:09Z","receivedAt":"2006-08-25T23:47:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Rename git_blame to git_annotate, and git_blame2 to git_blame.\nLink git_annotate under \"annotate\" action.  Add link to \"blame\nin git_annotate, and to \"annotate\" in git_blame.\n\ngit_annotate doesn't work correctly yet - error during parsing\nsome lines.  Needs investigation.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nNot for work, just for testing and comparing the two implementations.\nApplies cleanly to 'next' (v1.4.2-g6580c6b).\n\n gitweb/gitweb.perl |   13 ++++++++++---\n 1 files changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex a6d6637..6344263 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -229,7 +229,8 @@ if (defined $searchtext) {\n \n # dispatch\n my %actions = (\n-\t\"blame\" => \\&git_blame2,\n+\t\"blame\" => \\&git_blame,\n+\t\"annotate\" => \\&git_annotate,\n \t\"blobdiff\" => \\&git_blobdiff,\n \t\"blobdiff_plain\" => \\&git_blobdiff_plain,\n \t\"blob\" => \\&git_blob,\n@@ -2166,7 +2167,7 @@ sub git_tag {\n \tgit_footer_html();\n }\n \n-sub git_blame2 {\n+sub git_blame {\n \tmy $fd;\n \tmy $ftype;\n \n@@ -2193,6 +2194,9 @@ sub git_blame2 {\n \t\t$cgi->a({-href => href(action=>\"blob\", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},\n \t\t        \"blob\") .\n \t\t\" | \" .\n+\t\t$cgi->a({-href => href(action=>\"annotate\", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},\n+\t\t        \"annotate\") .\n+\t\t\" | \" .\n \t\t$cgi->a({-href => href(action=>\"blame\", file_name=>$file_name)},\n \t\t        \"head\");\n \tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n@@ -2236,7 +2240,7 @@ HTML\n \tgit_footer_html();\n }\n \n-sub git_blame {\n+sub git_annotate {\n \tmy $fd;\n \n \tif (!gitweb_check_feature('blame')) {\n@@ -2258,6 +2262,9 @@ sub git_blame {\n \t\t$cgi->a({-href => href(action=>\"blob\", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},\n \t\t        \"blob\") .\n \t\t\" | \" .\n+\t\t$cgi->a({-href => href(action=>\"blame\", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)},\n+\t\t        \"blame\") .\n+\t\t\" | \" .\n \t\t$cgi->a({-href => href(action=>\"blame\", file_name=>$file_name)},\n \t\t        \"head\");\n \tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n-- \n1.4.1.1\n"},{"id":"25909","messageId":"200608260213.06176.jnareb@gmail.com","threadId":"5385","inReplyTo":"200608260147.10880.jnareb@gmail.com","subject":"[PATCH] gitweb: git_annotate didn't expect negative numeric timezone","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-26T00:13:05Z","receivedAt":"2006-08-26T00:13:05Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis fixes error in git_annotate mentioned in parent post.\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 6344263..e5a0db5 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2298,7 +2298,7 @@ HTML\n \t\tchomp $line;\n \t\t$line_class_num = ($line_class_num + 1) % $line_class_len;\n \n-\t\tif ($line =~ m/^([0-9a-fA-F]{40})\\t\\(\\s*([^\\t]+)\\t(\\d+) \\+\\d\\d\\d\\d\\t(\\d+)\\)(.*)$/) {\n+\t\tif ($line =~ m/^([0-9a-fA-F]{40})\\t\\(\\s*([^\\t]+)\\t(\\d+) [+-]\\d\\d\\d\\d\\t(\\d+)\\)(.*)$/) {\n \t\t\t$long_rev = $1;\n \t\t\t$author   = $2;\n \t\t\t$time     = $3;\n-- \n1.4.1.1\n"}]}