summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2007-05-06 23:10:03 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-05-08 01:20:18 (GMT)
commit78bc403aaffe4dc7854da118e977685b38bdc5b7 (patch)
tree04a0de5ec88d825a792bf145e2c5117ffcd657ed /gitweb
parent3082acfa7c626a34aa419a163585051c2df2bf09 (diff)
downloadgit-78bc403aaffe4dc7854da118e977685b38bdc5b7.zip
git-78bc403aaffe4dc7854da118e977685b38bdc5b7.tar.gz
git-78bc403aaffe4dc7854da118e977685b38bdc5b7.tar.bz2
gitweb: Add parsing of raw combined diff format to parse_difftree_raw_line
Add parsing line of raw combined diff ("git diff-tree -c/-cc" output) as described in section "diff format for merges" in diff-format.txt to parse_difftree_raw_line subroutine. Returned hash (or hashref) has for combined diff 'nparents' key which holds number of parents in a merge. At keys 'from_mode' and 'from_id' there are arrayrefs holding modes and ids, respectively. There is no 'similarity' value, and there is only 'to_file' value and no 'from_file' value. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl11
1 files changed, 11 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ba5cc43..dfba399 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1495,6 +1495,17 @@ sub parse_difftree_raw_line {
$res{'file'} = unquote($7);
}
}
+ # '::100755 100755 100755 60e79ca1b01bc8b057abe17ddab484699a7f5fdb 94067cc5f73388f33722d52ae02f44692bc07490 94067cc5f73388f33722d52ae02f44692bc07490 MR git-gui/git-gui.sh'
+ # combined diff (for merge commit)
+ elsif ($line =~ s/^(::+)((?:[0-7]{6} )+)((?:[0-9a-fA-F]{40} )+)([a-zA-Z]+)\t(.*)$//) {
+ $res{'nparents'} = length($1);
+ $res{'from_mode'} = [ split(' ', $2) ];
+ $res{'to_mode'} = pop @{$res{'from_mode'}};
+ $res{'from_id'} = [ split(' ', $3) ];
+ $res{'to_id'} = pop @{$res{'from_id'}};
+ $res{'status'} = [ split('', $4) ];
+ $res{'to_file'} = unquote($5);
+ }
# 'c512b523472485aef4fff9e57b229d9d243c967f'
elsif ($line =~ m/^([0-9a-fA-F]{40})$/) {
$res{'commit'} = $1;