On Sat, May 10, 2008 at 11:16 PM, Brandon Casey <drafnel@gmail.com> wrote:completely untested and hopefully not mangled by google... actually, this will do nothing for the case where there exists many loose unreachable objects and no loose reachable objects since we won't create a new pack with an updated timestamp to compare against. So git-gc will continue to spin its wheels without getting anywhere. Could we update the pack timestamp after running git-gc or use a timestamp from someplace else? -brandon diff --git a/builtin-gc.c b/builtin-gc.c index 48f7d95..16b1455 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -27,6 +27,7 @@ static int aggressive_window = -1; static int gc_auto_threshold = 6700; static int gc_auto_pack_limit = 50; static char *prune_expire = "2.weeks.ago"; +static time_t gc_auto_pack_frequency = 21600; /* 6 hours */ #define MAX_ADD 10 static const char *argv_pack_refs[] = {"pack-refs", "--all", "--prune", NULL}; @@ -56,6 +57,10 @@ static int gc_config(const char *var, const char *value) gc_auto_pack_limit = git_config_int(var, value); return 0; } + if (!strcmp(var, "gc.autopackfrequency")) { + gc_auto_pack_frequency = git_config_ulong(var, value); + return 0; + } if (!strcmp(var, "gc.pruneexpire")) { if (!value) return config_error_nonbool(var); @@ -205,6 +210,14 @@ static int need_to_gc(void) else if (!too_many_loose_objects()) return 0; + if (gc_auto_pack_frequency) { + prepare_packed_git(); + if (packed_git && + packed_git->mtime > + approxidate("now") - gc_auto_pack_frequency) + return 0; + } + if (run_hook()) return 0; return 1; -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Eric Paris | TALPA - a threat model? well sorta. |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Andrew Morton | Re: [BUILD-FAILURE] 2.6.26-rc8-mm1 - x86 - __ptep_modify_prot_start() missing |
| Bodo Eggert | Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override. |
git: | |
| Pavel Roskin | Implementing branch attributes in git config |
| Jon Smirl | Importing Mozilla CVS into git |
| Jon Smirl | Figured out how to get Mozilla into git |
| Jakub Narebski | Re: VCS comparison table |
| Richard Stallman | Real men don't attack straw men |
| Adam Getchell | Re: About Xen: maybe a reiterative question but .. |
| carlopmart | About Xen: maybe a reiterative question but .. |
| Bertram Scharpf | First install: Grub doesn't find partitions |
| Waskiewicz Jr, Peter P | RE: [PATCH 2/3][NET_BATCH] net core use batching |
| Jeff Kirsher | [PATCH 1/3] e1000e: add support for the 82567LM-4 device |
| Ayaz Abdulla | [PATCH] forcedeth: msi interrupts |
| Corey Hickey | [PATCH 10/10] Use nested compat attributes to pass parameters. |
