summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 936b705)
raw | patch | inline | side by side (parent: 936b705)
author | Nicolas Pitre <nico@cam.org> | |
Tue, 30 Dec 2008 19:45:11 +0000 (14:45 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 1 Jan 2009 12:51:51 +0000 (04:51 -0800) |
When there is no grace period before pruning unreferenced objects, it is
pointless to push those objects in their loose form just to delete them
right away.
Also be more explicit about the possibility of using "now" in the
gc.pruneexpire config variable (needed for the above behavior to
happen).
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pointless to push those objects in their loose form just to delete them
right away.
Also be more explicit about the possibility of using "now" in the
gc.pruneexpire config variable (needed for the above behavior to
happen).
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | patch | blob | history | |
builtin-gc.c | patch | blob | history |
index 52786c7df5eb902cf97fee165ceb25e3c4763e9e..41dd0f3e9f7881e4a7aa7810ad4d179bc957732a 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
gc.pruneexpire::
When 'git-gc' is run, it will call 'prune --expire 2.weeks.ago'.
- Override the grace period with this config variable.
+ Override the grace period with this config variable. The value
+ "now" may be used to disable this grace period and always prune
+ unreachable objects immediately.
gc.reflogexpire::
'git-reflog expire' removes reflog entries older than
diff --git a/builtin-gc.c b/builtin-gc.c
index 781df601c5f95e874297e0e8bec3fddeb929cc2d..f8eae4adb41d9c338c07aa161e7305bb16742a1e 100644 (file)
--- a/builtin-gc.c
+++ b/builtin-gc.c
* there is no need.
*/
if (too_many_packs())
- append_option(argv_repack, "-A", MAX_ADD);
+ append_option(argv_repack,
+ !strcmp(prune_expire, "now") ? "-a" : "-A",
+ MAX_ADD);
else if (!too_many_loose_objects())
return 0;
"run \"git gc\" manually. See "
"\"git help gc\" for more information.\n");
} else
- append_option(argv_repack, "-A", MAX_ADD);
+ append_option(argv_repack,
+ !strcmp(prune_expire, "now") ? "-a" : "-A",
+ MAX_ADD);
if (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD))
return error(FAILED_RUN, argv_pack_refs[0]);