git-gui: use "blame -w -C -C" for "where did it come from, originally?"
The blame window shows "who wrote the piece originally" and "who moved it there" in two columns. In order to identify the former more correctly, it helps to use the new -w option. [sp: Minor change to only enable -w if underlying git >= 1.5.3] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Junio C Hamano committed
Jun 20, 2007 at 21:44 UTC
a840566770c262f76e8fd7fb69239fbedd10b259
1 file changed
+9
-1
lib/blame.tcl
+9
-1
@@ -33,6 +33,13 @@ variable group_colors {
33
#ececec
34
}
35
36
+# Switches for original location detection
37
+#
38
+variable original_options [list -C -C]
39
+if {[git-version >= 1.5.3]} {
40
+ lappend original_options -w ; # ignore indentation changes
41
+}
42
+
43
# Current blame data; cleared/reset on each load
44
#
45
field commit ; # input commit to blame
@@ -512,6 +519,7 @@ method _exec_blame {cur_w cur_d options cur_s} {
519
method _read_blame {fd cur_w cur_d cur_s} {
520
upvar #0 $cur_d line_data
521
variable group_colors
522
+ variable original_options
523
524
if {$fd ne $current_fd} {
525
catch {close $fd}
@@ -681,7 +689,7 @@ method _read_blame {fd cur_w cur_d cur_s} {
689
close $fd
690
if {$cur_w eq $w_asim} {
691
_exec_blame $this $w_amov @amov_data \
684
- [list -M -C -C] \
692
+ $original_options \
693
{ original location}
694
} else {
695
set current_fd {}