{"thread":{"id":"16927","subject":"[PATCH,RESEND] objects to be pruned immediately don't have to be loosened","startedAt":"2008-12-30T19:45:11Z","lastAt":"2009-01-01T21:00:35Z","messageCount":2,"participants":["Nicolas Pitre","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"98986","messageId":"alpine.LFD.2.00.0812301441540.30266@xanadu.home","threadId":"16927","inReplyTo":null,"subject":"[PATCH,RESEND] objects to be pruned immediately don't have to be loosened","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-12-30T19:45:11Z","receivedAt":"2008-12-30T19:45:11Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"\nWhen there is no grace period before pruning unreferenced objects, it is\npointless to push those objects in their loose form just to delete them\nright away.\n\nAlso be more explicit about the possibility of using \"now\" in the\ngc.pruneexpire config variable (needed for the above behavior to\nhappen).\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7408bb2..ea0cd97 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -702,7 +702,9 @@ gc.packrefs::\n \n gc.pruneexpire::\n \tWhen 'git-gc' is run, it will call 'prune --expire 2.weeks.ago'.\n-\tOverride the grace period with this config variable.\n+\tOverride the grace period with this config variable.  The value\n+\t\"now\" may be used to disable this  grace period and always prune\n+\tunreachable objects immediately.\n \n gc.reflogexpire::\n \t'git-reflog expire' removes reflog entries older than\ndiff --git a/builtin-gc.c b/builtin-gc.c\nindex 781df60..f8eae4a 100644\n--- a/builtin-gc.c\n+++ b/builtin-gc.c\n@@ -188,7 +188,9 @@ static int need_to_gc(void)\n \t * there is no need.\n \t */\n \tif (too_many_packs())\n-\t\tappend_option(argv_repack, \"-A\", MAX_ADD);\n+\t\tappend_option(argv_repack,\n+\t\t\t      !strcmp(prune_expire, \"now\") ? \"-a\" : \"-A\",\n+\t\t\t      MAX_ADD);\n \telse if (!too_many_loose_objects())\n \t\treturn 0;\n \n@@ -243,7 +245,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)\n \t\t\t\"run \\\"git gc\\\" manually. See \"\n \t\t\t\"\\\"git help gc\\\" for more information.\\n\");\n \t} else\n-\t\tappend_option(argv_repack, \"-A\", MAX_ADD);\n+\t\tappend_option(argv_repack,\n+\t\t\t      !strcmp(prune_expire, \"now\") ? \"-a\" : \"-A\",\n+\t\t\t      MAX_ADD);\n \n \tif (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD))\n \t\treturn error(FAILED_RUN, argv_pack_refs[0]);\n"},{"id":"99112","messageId":"7vfxk2ivws.fsf@gitster.siamese.dyndns.org","threadId":"16927","inReplyTo":"alpine.LFD.2.00.0812301441540.30266@xanadu.home","subject":"Re: [PATCH,RESEND] objects to be pruned immediately don't have to be loosened","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-01T21:00:35Z","receivedAt":"2009-01-01T21:00:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  I take this as a usability fix for large repository?\n"}]}