Re: [PATCH 1/1] clean: further clean-up of implementation around "--force"
- From
Sergey Organov <sorganov@gmail.com>
- Date
- Mar 4, 2024, 18:46 UTC
- Message-ID
- <87cys996nf.fsf@osv.gnss.ru>
- In-Reply-To
- <20240303220600.2491792-2-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 23 quoted lines
> We clarified how clean.requireForce interacts with the --dry-run > option in the previous commit, both in the implementation and in the > documentation. Even when "git clean" (without other options) is > required to be used with "--force" (i.e. either clean.requireForce > is unset, or explicitly set to true) to protect end-users from > casual invocation of the command by mistake, "--dry-run" does not > require "--force" to be used, because it is already its own > protection mechanism by being a no-op to the working tree files. > > The previous commit, however, missed another clean-up opportunity > around the same area. Just like in the "--dry-run" mode, the > command in the "--interactive" mode does not require "--force", > either. This is because by going interactive and giving the end > user one more step to confirm, the mode itself is serving as its own > protection mechanism. > > Let's take things one step further, unify the code that defines > interaction between `--force` and these two other options. Just > like we added explanation for the reason why "--dry-run" does not > honor `clean.requireForce`, add the same explanation for > "--interactive". Finally, add some tests to show the interaction > between "--force" and "--interactive" (we already have tests that > show interaction between "--force" and "--dry-run").
Looks fine to me, including the patch itself.
Thanks, -- Sergey Organov