From: "Jan Krüger" <jk@jk.gs>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Thomas Rast <trast@student.ethz.ch>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Documentation: pruning recipe for destructive filter-branch
Date: Sat, 14 Feb 2009 07:49:54 +0100 [thread overview]
Message-ID: <20090214074954.7e423dd2@perceptron> (raw)
In-Reply-To: <alpine.DEB.1.00.0902140642520.10279@pacific.mpi-cbg.de>
Hi,
On Sat, 14 Feb 2009 06:46:18 +0100 (CET), Johannes Schindelin
<Johannes.Schindelin@gmx.de> 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?= <jk@jk.gs>
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 <jk@jk.gs>
---
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 <time>::
+ Expire unreachable objects older than <time>, rather than
+ considering the configuration variable or the default explained in
+ the next section.
+
--quiet::
Suppress all progress reports.
diff --git a/builtin-gc.c b/builtin-gc.c
index a201438..a62c762 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -179,16 +179,17 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
int quiet = 0;
char buf[80];
+ git_config(gc_config, NULL);
+
struct option builtin_gc_options[] = {
OPT_BOOLEAN(0, "prune", &prune, "prune unreferenced objects (deprecated)"),
+ OPT_STRING(0, "prune-expire", &prune_expire, "time", "expire unreferenced objects older than <time>"),
OPT_BOOLEAN(0, "aggressive", &aggressive, "be more thorough (increased runtime)"),
OPT_BOOLEAN(0, "auto", &auto_gc, "enable auto-gc mode"),
OPT_BOOLEAN('q', "quiet", &quiet, "suppress progress reports"),
OPT_END()
};
- git_config(gc_config, NULL);
-
if (pack_refs < 0)
pack_refs = !is_bare_repository();
--
1.6.2.rc0.61.g5cd12.dirty
next prev parent reply other threads:[~2009-02-14 6:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-13 17:14 [PATCH] Documentation: pruning recipe for destructive filter-branch Thomas Rast
2009-02-14 1:07 ` Junio C Hamano
2009-02-14 1:51 ` Jan Krüger
2009-02-14 5:46 ` Johannes Schindelin
2009-02-14 6:49 ` Jan Krüger [this message]
2009-02-14 11:48 ` Johannes Schindelin
2009-02-14 14:22 ` [PATCH v2] " Thomas Rast
2009-02-14 19:12 ` Johannes Schindelin
2009-02-14 19:29 ` Junio C Hamano
2009-02-14 20:56 ` [PATCH v3] " Thomas Rast
2009-02-14 19:02 ` [PATCH] gc: make --prune useful again by accepting an optional parameter Johannes Schindelin
2009-02-14 21:33 ` Thomas Rast
2009-02-14 21:33 ` Jan Krüger
2009-02-14 22:05 ` Johannes Schindelin
2009-02-14 22:10 ` [PATCH v2] " Johannes Schindelin
2009-02-14 22:38 ` Thomas Rast
2009-02-15 19:33 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090214074954.7e423dd2@perceptron \
--to=jk@jk.gs \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).