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

Re: [PATCH v2] gc: recommend `git gc --prune=now` instead of `git prune`

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2020, 05:07 UTC
Message-ID
<xmqqv9k0j087.fsf@gitster.c.googlers.com>
In-Reply-To
<pull.652.v2.git.1591662224566.gitgitgadget@gmail.com>
"John Lin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> From: John Lin <johnlinp@gmail.com>
>
> `git prune` is a plumbing command and should not be run directly by
> users. The corresponding porcelain command is `git gc`, which is
> mentioned in the man page of `git prune`.
Much better than v1 that came without any justification ;-)

I however wouldn't say "should not"---that feels a bit too strong (I personally use "prune" from the command line once or twice every week and do not see why I should be forbidden from doing so [*1*]), but the users who see this message would not need such a precise control afforded by use of "git prune", so "gc --prune=now" is a better recommendation.

Thanks.
[Footnote]
*1* The command does not even produce a machine readable output.
    The reason it is not recommended (but that is different from
    "should not") to casual users over "git gc" is because it is a
    very focused tool (it is only about removing loose objects and
    does not touch other things) and applicable to a very specific
    condition.  Those who can recognize that they are in that
    situation should not be forbidden from using it with a dogmatic
    "should not".
Previous: John Lin via GitGitGadgetNext: Ævar Arnfjörð Bjarmason
Message 4 of 9 in “Recommend "git gc --prune=now" instead of "git prune"”
  1. Recommend "git gc --prune=now" instead of "git prune"John Lin via GitGitGadget, Jun 8, 2020
  2. Denton LiuJun 8, 2020
  3. gc: recommend `git gc --prune=now` instead of `git prune`John Lin via GitGitGadget, Jun 9, 2020
  4. Junio C HamanoJun 9, 2020
  5. Ævar Arnfjörð BjarmasonJun 9, 2020
  6. Junio C HamanoJun 9, 2020
  7. 林自均Jun 10, 2020
  8. Denton LiuJun 10, 2020
  9. 林自均Jun 10, 2020

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.