summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae72f68)
raw | patch | inline | side by side (parent: ae72f68)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 27 Dec 2006 09:24:05 +0000 (01:24 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 27 Dec 2006 09:33:24 +0000 (01:33 -0800) |
Two configuration to control the expiration of rerere records
are introduced and documented.
Signed-off-by: Junio C Hamano <junkio@cox.net>
are introduced and documented.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/config.txt | patch | blob | history | |
Documentation/git-rerere.txt | patch | blob | history | |
builtin-rerere.c | patch | blob | history |
index 22482d6a94e88544935eee5f560089b9a4bf0dfa..4d636267a3c58f194c3e0e5c682ac5cff8271900 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
Additional email headers to include in a patch to be submitted
by mail. See gitlink:git-format-patch[1].
+gc.rerereresolved::
+ Records of conflicted merge you resolved earlier are
+ kept for this many days when `git rerere gc` is run.
+ The default is 60 days. See gitlink:git-rerere[1].
+
+gc.rerereunresolved::
+ Records of conflicted merge you have not resolved are
+ kept for this many days when `git rerere gc` is run.
+ The default is 15 days. See gitlink:git-rerere[1].
+
gitcvs.enabled::
Whether the cvs pserver interface is enabled for this repository.
See gitlink:git-cvsserver[1].
index 116dca4c0668488a0ba55b43a10e89c40f087b59..b57a72bdd776c2ecd38adeb97497a3b19be704e7 100644 (file)
SYNOPSIS
--------
-'git-rerere' [clear|diff|status]
+'git-rerere' [clear|diff|status|gc]
DESCRIPTION
-----------
'gc'::
This command is used to prune records of conflicted merge that
-occurred long time ago.
+occurred long time ago. By default, conflicts older than 15
+days that you have not recorded their resolution, and conflicts
+older than 60 days, are pruned. These are controlled with
+`gc.rerereunresolved` and `gc.rerereresolved` configuration
+variables.
DISCUSSION
diff --git a/builtin-rerere.c b/builtin-rerere.c
index d064bd8bf0218feb7d4ad01b39be6a143757499e..7442498deedfef1f6be9e550f3c0259aaa82e0ba 100644 (file)
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
return write_rr(rr, fd);
}
+static int git_rerere_config(const char *var, const char *value)
+{
+ if (!strcmp(var, "gc.rerereresolved"))
+ cutoff_resolve = git_config_int(var, value);
+ else if (!strcmp(var, "gc.rerereunresolved"))
+ cutoff_noresolve = git_config_int(var, value);
+ else
+ return git_default_config(var, value);
+ return 0;
+}
+
int cmd_rerere(int argc, const char **argv, const char *prefix)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
if (stat(git_path("rr-cache"), &st) || !S_ISDIR(st.st_mode))
return 0;
+ git_config(git_rerere_config);
+
merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
read_rr(&merge_rr);