git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Git Mailing list <git@vger.kernel.org>
Subject: Re: is it "git gc --prune=now" or "git gc --prune=all"?
Date: Tue, 5 Mar 2019 00:03:27 -0500	[thread overview]
Message-ID: <20190305050326.GK19800@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.LFD.2.21.1903020323110.16672@localhost.localdomain>

On Sat, Mar 02, 2019 at 03:26:37AM -0500, Robert P. J. Day wrote:

>   more pedantry, but digging through "git gc", the man page reads:
> 
>        --prune=<date>
>            Prune loose objects older than date (default is 2 weeks
>            ago, overridable by the config variable gc.pruneExpire).
>            --prune=all prunes loose objects regardless of their age
>            ^^^^^^^^^^^
> 
> but the code for gc.c contains a check for "now" (which actually makes
> more sense semantically):
> 
>   static void add_repack_all_option(struct string_list *keep_pack)
>   {
>         if (prune_expire && !strcmp(prune_expire, "now"))
>                 argv_array_push(&repack, "-a");
>         else {
>         ... snip ...
> 
> while the man page does not seem to mention the possible value of
> "now".
> 
>   am i misreading something? should the man page mention the possible
> value of "now" as opposed to "all"?

Using "all" would also work. It wouldn't shortcut to using "-a" (which
lets pack-objects save a little work), but it is handled in
parse_expiry_date() the same as "now". I do think the documentation
should recommend "now". Possibly builtin/gc.c should be smarter about
recognizing "all" in the conditional you quoted, too, though I don't
know that it's all that important (especially if we tweak the
documentation).

-Peff

  reply	other threads:[~2019-03-05  5:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  8:26 is it "git gc --prune=now" or "git gc --prune=all"? Robert P. J. Day
2019-03-05  5:03 ` Jeff King [this message]
2019-03-06  0:08   ` Junio C Hamano
2019-03-09 18:13     ` Robert P. J. Day
2019-03-11  2:18       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190305050326.GK19800@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).