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

[PATCH 3/4] gitweb: Extend parse_difftree_raw_line to save commit info

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 30, 2006, 22:36 UTC
Message-ID
<200608310036.04302.jnareb@gmail.com>
In-Reply-To
<200608310030.33512.jnareb@gmail.com>

Extend parse_difftree_raw_line to save commit info from when git-diff-tree is given only one <tree-ish>, for example when fed from git-rev-list using --stdin option.

git-diff-tree outputs a line with the commit ID when applicable.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This can be applied regardless that it is proof-of-concept series.
Need checking if it doesn't break anything.
 gitweb/gitweb.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d8b94a1..b193bc6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1014,9 +1014,9 @@ sub parse_difftree_raw_line {
 		}
 	}
 	# 'c512b523472485aef4fff9e57b229d9d243c967f'
-	#elsif ($line =~ m/^([0-9a-fA-F]{40})$/) {
-	#	$res{'commit'} = $1;
-	#}
+	elsif ($line =~ m/^([0-9a-fA-F]{40})$/) {
+		$res{'commit'} = $1;
+	}
 
 	return wantarray ? %res : \%res;
 }
-- 
1.4.1.1
Previous: Jakub NarebskiNext: Jakub Narebski
Message 3 of 4 in “gitweb: Move git-ls-tree output parsing to parse_ls_tree_line”
  1. 1/4 gitweb: Move git-ls-tree output parsing to parse_ls_tree_lineJakub Narebski, Aug 30, 2006
  2. 2/4 gitweb: Separate printing of git_tree row into git_print_tree_entryJakub Narebski, Aug 30, 2006
  3. 3/4 gitweb: Extend parse_difftree_raw_line to save commit infoJakub Narebski, Aug 30, 2006
  4. 4/4 gitweb: Add "tree_blame" view (WIP)Jakub Narebski, Aug 30, 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.