aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/config
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-03 14:06:00 -0800
committerJunio C Hamano <gitster@pobox.com>2024-03-04 14:05:13 -0800
commit105ec9ae8d0d100994ddf1ee5e99e4616558ff90 (patch)
tree5d105e589cf83073a9c583c1c1417100d43310f4 /Documentation/config
parent12a4883feb53d08a80b3c049415105b0543f27a5 (diff)
downloadgit-105ec9ae8d0d100994ddf1ee5e99e4616558ff90.tar.gz
clean: further clean-up of implementation around "--force"
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 chance to confirm, the mode itself is serving as its own protection mechanism. Let's take things one step further, and 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", give an explanation for the reason why "--interactive" makes "clean.requireForce" to be ignored. Finally, add some tests to show the interaction between "--force" and "--interactive". We already have tests that show interaction between "--force" and "--dry-run", but didn't test "--interactive". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config')
-rw-r--r--Documentation/config/clean.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/config/clean.txt b/Documentation/config/clean.txt
index b19ca210f3..c0188ead4e 100644
--- a/Documentation/config/clean.txt
+++ b/Documentation/config/clean.txt
@@ -1,3 +1,3 @@
clean.requireForce::
A boolean to make git-clean refuse to delete files unless -f
- or -i is given. Defaults to true.
+ is given. Defaults to true.