summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar Alexander Gavrilov <angavrilov@gmail.com>2008-07-17 00:43:48 +0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-07-16 22:09:28 -0400
commit57cae87b77c93e8bdfd11293f11f140ff827269a (patch)
treec43ab54c9fe9a834f72841b63539955a2a81011d /lib
parentFix pre-commit hooks under MinGW/MSYS (diff)
downloadtgif-57cae87b77c93e8bdfd11293f11f140ff827269a.tar.xz
Add options to control the search for copies in blame.
On huge repositories, -C -C can be way too slow to be unconditionally enabled, and it can also be useful to control its precision. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/blame.tcl20
-rw-r--r--lib/option.tcl2
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 92fac1bad4..192505d983 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -33,13 +33,6 @@ variable group_colors {
#ececec
}
-# Switches for original location detection
-#
-variable original_options [list -C -C]
-if {[git-version >= 1.5.3]} {
- lappend original_options -w ; # ignore indentation changes
-}
-
# Current blame data; cleared/reset on each load
#
field commit ; # input commit to blame
@@ -511,7 +504,6 @@ method _exec_blame {cur_w cur_d options cur_s} {
method _read_blame {fd cur_w cur_d} {
upvar #0 $cur_d line_data
variable group_colors
- variable original_options
if {$fd ne $current_fd} {
catch {close $fd}
@@ -684,6 +676,18 @@ method _read_blame {fd cur_w cur_d} {
if {[eof $fd]} {
close $fd
if {$cur_w eq $w_asim} {
+ # Switches for original location detection
+ set threshold [get_config gui.copyblamethreshold]
+ set original_options [list "-C$threshold"]
+
+ if {![is_config_true gui.fastcopyblame]} {
+ # thorough copy search; insert before the threshold
+ set original_options [linsert $original_options 0 -C]
+ }
+ if {[git-version >= 1.5.3]} {
+ lappend original_options -w ; # ignore indentation changes
+ }
+
_exec_blame $this $w_amov @amov_data \
$original_options \
[mc "Loading original location annotations..."]
diff --git a/lib/option.tcl b/lib/option.tcl
index 9270512582..ffb3f00ff0 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -123,6 +123,8 @@ proc do_options {} {
{b gui.trustmtime {mc "Trust File Modification Timestamps"}}
{b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
+ {b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
+ {i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
{t gui.newbranchtemplate {mc "New Branch Name Template"}}