git/list[1] front-page[2] threads[3] people[4] search[5] about
 

is it "git gc --prune=now" or "git gc --prune=all"?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Mar 2, 2019, 08:26 UTC
Message-ID
<alpine.LFD.2.21.1903020323110.16672@localhost.localdomain>
  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"?
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Next: Jeff King
Message 1 of 5 in “is it "git gc --prune=now" or "git gc --prune=all"?”
  1. Robert P. J. DayMar 2, 2019
  2. Jeff KingMar 5, 2019
  3. Junio C HamanoMar 6, 2019
  4. Robert P. J. DayMar 9, 2019
  5. Junio C HamanoMar 11, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.