Shawn O. Pearce  committed 0f32da5

git-gui: Favor the original annotations over the recent ones

Usually when you are looking at blame annotations for a region of
a file you are more interested in why something was originally
done then why it is here now. This is because most of the time
when we get original annotation data we are looking at a simple
refactoring performed to better organize code, not to change its
semantic meaning or function. Reorganizations are sometimes of
interest, but not usually.

We now show the original commit data first in the tooltip. This
actually looks quite nice as the original commit will usually have an
author date prior to the current (aka move/copy) annotation's commit,
so the two commits will now tend to appear in chronological order.

I also found myself to always be clicking on the line of interest
in the file column but I always wanted the original tracking data
and not the move/copy data. So I changed our default commit from
$asim_data (the simple move/copy annotation) to the more complex
$amov_data (the -M -C -C original annotation).

Signed-off-by: Shawn O. Pearce <>

  • Participants
  • Parent commits 949da61
  • Branches master

Comments (0)

Files changed (1)

File lib/blame.tcl

-	if {$cur_w eq $w_amov} {
-		set dat [lindex $amov_data $lno]
-		set highlight_column $w_amov
-	} else {
+	if {$cur_w eq $w_asim} {
 		set dat [lindex $asim_data $lno]
 		set highlight_column $w_asim
+	} else {
+		set dat [lindex $amov_data $lno]
+		set highlight_column $w_amov
 	$w_cviewer conf -state normal
 	$tooltip_t insert end "$summary"
 	if {$org ne {} && [lindex $org 0] ne $cmit} {
-		$tooltip_t insert 0.0 "Copied/Moved Here By:\n" section_header
+		set save [$tooltip_t get 0.0 end]
+		$tooltip_t delete 0.0 end
 		set cmit [lindex $org 0]
 		set file [lindex $org 1]
 		lappend tooltip_commit $cmit
 			-format {%Y-%m-%d %H:%M:%S}
-		$tooltip_t insert end "\n\n"
 		$tooltip_t insert end "Originally By:\n" section_header
 		$tooltip_t insert end "commit $cmit\n"
 		$tooltip_t insert end "$author_name  $author_time\n"
-		$tooltip_t insert end "$summary"
+		$tooltip_t insert end "$summary\n"
 		if {$file ne $path} {
-			$tooltip_t insert end "\n"
 			$tooltip_t insert end "In File: " section_header
-			$tooltip_t insert end $file
+			$tooltip_t insert end "$file\n"
+		$tooltip_t insert end "\n"
+		$tooltip_t insert end "Copied Or Moved Here By:\n" section_header
+		$tooltip_t insert end $save
 	$tooltip_t conf -state disabled