{"thread":{"id":"5136","subject":"[PATCH 3/4] gitweb: git_tree displays blame based on repository config","startedAt":"2006-08-04T22:14:27Z","lastAt":"2006-08-04T22:14:27Z","messageCount":1,"participants":["Luben Tuikov"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"24765","messageId":"20060804221427.38373.qmail@web31807.mail.mud.yahoo.com","threadId":"5136","inReplyTo":null,"subject":"[PATCH 3/4] gitweb: git_tree displays blame based on repository config","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-04T22:14:27Z","receivedAt":"2006-08-04T22:14:27Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"git_tree() will now conditionally display \"blame\"\ndepending on how \"gitweb.blame\" variable is configured\nusing \"git-repo-config\".\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.perl |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 69b787f..723823a 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1757,6 +1757,7 @@ sub git_tree {\n \tgit_header_html();\n \tmy $base_key = \"\";\n \tmy $base = \"\";\n+\tmy $have_blame = git_get_project_config_bool ('blame');\n \tif (defined $hash_base && (my %co = git_read_commit($hash_base))) {\n \t\t$base_key = \";hb=$hash_base\";\n \t\tgit_page_nav('tree','', $hash_base);\n@@ -1792,9 +1793,11 @@ sub git_tree {\n \t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name\"), -class => \"list\"}, esc_html($t_name)) .\n \t\t\t      \"</td>\\n\" .\n \t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name\")}, \"blob\") .\n-#\t\t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name\")}, \"blame\") .\n-\t\t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name\")}, \"history\") .\n+\t\t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name\")}, \"blob\");\n+\t\t\tif ($have_blame) {\n+\t\t\t\tprint \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name\")}, \"blame\");\n+\t\t\t}\n+\t\t\tprint \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name\")}, \"history\") .\n \t\t\t      \" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob_plain;h=$t_hash;f=$base$t_name\")}, \"raw\") .\n \t\t\t      \"</td>\\n\";\n \t\t} elsif ($t_type eq \"tree\") {\n-- \n1.4.2.rc3.g6df3\n\n"}]}