From: Jan Krüger Date: Sat, 14 Feb 2009 06:49:54 GMT Subject: Re: [PATCH] Documentation: pruning recipe for destructive filter-branch Message-ID: <20090214074954.7e423dd2@perceptron> In-Reply-To: Hi, On Sat, 14 Feb 2009 06:46:18 +0100 (CET), Johannes Schindelin wrote: > > Is the --expire=now actually needed for prune? The way I read it > > git-prune(1), it defaults to pruning everything anyway. > > [...] Ah, that default is only set in "git gc", and "git prune" still > prunes everything. [...] But maybe we do not want to direct the user > to use "prune" here, but rather "gc"? I just read the source code of gc and noticed that the only way to influence its expiration limit for prune is to set it in the config file (gc.pruneExpire). Thus there is no immediate way to tell gc to prune *all* unreachable objects and we need to stick to the instructions that are in the patch (minus the unnecessary --expire=now for prune). The alternative would be to add a command line option to gc that corresponds to gc.pruneExpire. I don't really care about that, but a patch for it is below. -Jan -----8<----- From 42226c6c542be4e9fff0817662115f180033e75a Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Jan=20Kr=C3=BCger?= Date: Sat, 14 Feb 2009 07:39:23 +0100 Subject: [PATCH] gc: add --prune-expire option equivalent to gc.pruneExpire MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In semi-regular intervals, people tend to want to get rid of huge objects they accidentally created in a repository. Of course it shouldn't be too easy to do but also not too hard. Thus we allow them to get rid of unreferenced objects more easily once they have managed to make the objects unreferenced, by allowing them to override the prune expiration limit. Signed-off-by: Jan Krüger --- Documentation/git-gc.txt | 5 +++++ builtin-gc.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index 7086eea..a4d35fb 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -59,6 +59,11 @@ are consolidated into a single pack by using the `-A` option of 'git-repack'. Setting `gc.autopacklimit` to 0 disables automatic consolidation of packs. +--prune-expire