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".