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

[PATCH] Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output"

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 5, 2008, 20:13 UTC
Message-ID
<200804052213.31253.jnareb@gmail.com>
In-Reply-To
<200804051938.17855.jnareb@gmail.com>
This reverts commit 6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab.

It caused is_deleted() subroutine to output warnings when dealing with old, legacy gitweb blobdiff URLs without either 'hb' or 'hpb' parameters.

This fixes http://bugs.debian.org/469083
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
> It should be enough to revert commit 6aa6f92 (gitweb: Add 'status_str'
> to parse_difftree_raw_line output); it should fix this bug.
And here it is...
 gitweb/gitweb.perl |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1be75c6..1501ec8 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2204,7 +2204,7 @@ sub parse_difftree_raw_line {
 		$res{'to_mode'} = $2;
 		$res{'from_id'} = $3;
 		$res{'to_id'} = $4;
-		$res{'status'} = $res{'status_str'} = $5;
+		$res{'status'} = $5;
 		$res{'similarity'} = $6;
 		if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
 			($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
@@ -2220,7 +2220,6 @@ sub parse_difftree_raw_line {
 		$res{'to_mode'} = pop @{$res{'from_mode'}};
 		$res{'from_id'} = [ split(' ', $3) ];
 		$res{'to_id'} = pop @{$res{'from_id'}};
-		$res{'status_str'} = $4;
 		$res{'status'} = [ split('', $4) ];
 		$res{'to_file'} = unquote($5);
 	}
@@ -3068,7 +3067,7 @@ sub fill_from_file_info {
 sub is_deleted {
 	my $diffinfo = shift;
 
-	return $diffinfo->{'status_str'} =~ /D/;
+	return $diffinfo->{'to_id'} eq ('0' x 40);
 }
 
 # does patch correspond to [previous] difftree raw line
-- 
1.5.4.4
Previous: Jakub NarebskiNext: Gerrit Pape
Message 7 of 8 in “gitweb: Fix "Use of uninitialized value" error in 'history' view”
  1. gitweb: Fix "Use of uninitialized value" error in 'history' viewJakub Narebski, Apr 4, 2008
  2. Junio C HamanoApr 5, 2008
  3. Jakub NarebskiApr 5, 2008
  4. Gerrit PapeApr 5, 2008
  5. Jakub NarebskiApr 5, 2008
  6. Jakub NarebskiApr 5, 2008
  7. Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output"Jakub Narebski, Apr 5, 2008
  8. Gerrit PapeApr 6, 2008

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.