* [PATCH,RESEND] objects to be pruned immediately don't have to be loosened
@ 2008-12-30 19:45 Nicolas Pitre
2009-01-01 21:00 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pitre @ 2008-12-30 19:45 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
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>
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 7408bb2..ea0cd97 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -702,7 +702,9 @@ gc.packrefs::
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 781df60..f8eae4a 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -188,7 +188,9 @@ static int need_to_gc(void)
* 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;
@@ -243,7 +245,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
"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]);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH,RESEND] objects to be pruned immediately don't have to be loosened
2008-12-30 19:45 [PATCH,RESEND] objects to be pruned immediately don't have to be loosened Nicolas Pitre
@ 2009-01-01 21:00 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-01-01 21:00 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: git
Thanks. I take this as a usability fix for large repository?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-01 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-30 19:45 [PATCH,RESEND] objects to be pruned immediately don't have to be loosened Nicolas Pitre
2009-01-01 21:00 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).