@matheusbsbs / matheus-bagliano / commits / 669fbc3d09
Fork 0

git-gui: Combine blame groups only if commit and filename match

Consecutive chunks of a file could come from the same commit, but have different original file names. Previously we would have put them into a single group, but then the hyperlink would jump to only one of the files, and the other would not be accessible. Now we can get to the other file too. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jun 1, 2007 at 21:54 UTC 669fbc3d09b259bb3bc3bd2ab126ceb28db61b16
1 file changed +9 -3
lib/blame.tcl
+9 -3
@@ -518,8 +518,10 @@ method _read_blame {fd} {
518
519 set first_lno $lno
520 while {
521 - ![catch {set ncmit $line_commit([expr {$first_lno - 1}])}]
521 + ![catch {set ncmit $line_commit([expr {$first_lno - 1}])}]
522 + && ![catch {set nfile $line_file([expr {$first_lno - 1}])}]
523 && $ncmit eq $cmit
524 + && $nfile eq $file
525 } {
526 incr first_lno -1
527 }
@@ -572,8 +574,12 @@ method _read_blame {fd} {
574 incr blame_lines
575 }
576
575 - while {![catch {set ncmit $line_commit($lno)}]
576 - && $ncmit eq $cmit} {
577 + while {
578 + ![catch {set ncmit $line_commit($lno)}]
579 + && ![catch {set nfile $line_file($lno)}]
580 + && $ncmit eq $cmit
581 + && $nfile eq $file
582 + } {
583 $w_cgrp delete $lno.0 "$lno.0 lineend"
584
585 if {$lno == $first_lno} {