summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-15 12:48:08 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-15 15:08:27 -0800
commit3299c6f6a8a384453d025ffa117c5d8b35ba1972 (patch)
treea9067de664756254895eb8d532097d31534b35bc /config.c
parentf8348be3be8493a62110a09ab0343213990b416b (diff)
downloadgit-3299c6f6a8a384453d025ffa117c5d8b35ba1972.tar.gz
diff: make default rename detection limit configurable.
A while ago, a rename-detection limit logic was implemented as a response to this thread: http://marc.theaimsgroup.com/?l=git&m=112413080630175 where gitweb was found to be using a lot of time and memory to detect renames on huge commits. git-diff family takes -l<num> flag, and if the number of paths that are rename destination candidates (i.e. new paths with -M, or modified paths with -C) are larger than that number, skips rename/copy detection even when -M or -C is specified on the command line. This commit makes the rename detection limit easier to use. You can have: [diff] renamelimit = 30 in your .git/config file to specify the default rename detection limit. You can override this from the command line; giving 0 means 'unlimited': git diff -M -l0 We might want to change the default behaviour, when you do not have the configuration, to limit it to say 20 paths or so. This would also help the diffstat generation after a big 'git pull'. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index bd35138dae..915bb97523 100644
--- a/config.c
+++ b/config.c
@@ -229,6 +229,11 @@ int git_default_config(const char *var, const char *value)
return 0;
}
+ if (!strcmp(var, "diff.renamelimit")) {
+ diff_rename_limit_default = git_config_int(var, value);
+ return 0;
+ }
+
/* Add other config variables here.. */
return 0;
}