]> git.ipfire.org Git - thirdparty/git.git/commit
clean: improve -n and -f implementation and documentation
authorSergey Organov <sorganov@gmail.com>
Sun, 3 Mar 2024 09:50:32 +0000 (12:50 +0300)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Mar 2024 17:50:04 +0000 (09:50 -0800)
commit12a4883feb53d08a80b3c049415105b0543f27a5
tree2f32aa5e65dc0356cbc570b1d91f384305432143
parentb387623c12f3f4a376e4d35a610fd3e55d7ea907
clean: improve -n and -f implementation and documentation

What -n actually does in addition to its documented behavior is
ignoring of configuration variable clean.requireForce, that makes
sense provided -n prevents files removal anyway.

So, first, document this in the manual, and then modify implementation
to make this more explicit in the code.

Improved implementation also stops to share single internal variable
'force' between command-line -f option and configuration variable
clean.requireForce, resulting in more clear logic.

Two error messages with slightly different text depending on if
clean.requireForce was explicitly set or not, are merged into a single
one.

The resulting error message now does not mention -n as well, as it
neither matches intended clean.requireForce usage nor reflects
clarified implementation.

Documentation of clean.requireForce is changed accordingly.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/clean.txt
Documentation/git-clean.txt
builtin/clean.c