git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Fix git_blame

From
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Date
Sep 1, 2006, 03:43 UTC
Message-ID
<ed8a90$pfn$1@sea.gmane.org>

Converting the default values to array broke the git blame enable disable support. Fix the same.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 gitweb/gitweb.perl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0984e85..57ffa25 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2251,7 +2251,8 @@ sub git_blame2 {
 	my $fd;
 	my $ftype;
 
-	if (!gitweb_check_feature('blame')) {
+	my ($have_blame) = gitweb_check_feature('blame');
+	if (!$have_blame) {
 		die_error('403 Permission denied', "Permission denied");
 	}
 	die_error('404 Not Found', "File name not defined") if (!$file_name);
@@ -2320,7 +2321,8 @@ HTML
 sub git_blame {
 	my $fd;
 
-	if (!gitweb_check_feature('blame')) {
+	my ($have_blame) = gitweb_check_feature('blame');
+	if (!$have_blame) {
 		die_error('403 Permission denied', "Permission denied");
 	}
 	die_error('404 Not Found', "File name not defined") if (!$file_name);
@@ -2494,7 +2496,7 @@ sub git_blob {
 			die_error(undef, "No file name defined");
 		}
 	}
-	my $have_blame = gitweb_check_feature('blame');
+	my ($have_blame) = gitweb_check_feature('blame');
 	open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
 		or die_error(undef, "Couldn't cat $file_name, $hash");
 	my $mimetype = blob_mimetype($fd, $file_name);
@@ -2570,7 +2572,7 @@ sub git_tree {
 	my $ref = format_ref_marker($refs, $hash_base);
 	git_header_html();
 	my $base = "";
-	my $have_blame = gitweb_check_feature('blame');
+	my ($have_blame) = gitweb_check_feature('blame');
 	if (defined $hash_base && (my %co = parse_commit($hash_base))) {
 		git_print_page_nav('tree','', $hash_base);
 		git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);
-- 
1.4.2.rc1.g83e1-dirty
Next: Jakub Narebski
Message 1 of 6 in “gitweb: Fix git_blame”
  1. gitweb: Fix git_blameAneesh Kumar K.V, Sep 1, 2006
  2. Jakub NarebskiSep 1, 2006
  3. gitweb: gitweb_check_feature always return listJakub Narebski, Sep 1, 2006
  4. Junio C HamanoSep 1, 2006
  5. Jakub NarebskiSep 1, 2006
  6. Jakub NarebskiSep 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.