]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-clean: fix the description of the default behavior
authorMichael J Gruber <git@drmicha.warpmail.net>
Thu, 4 Feb 2010 16:01:16 +0000 (17:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Feb 2010 23:12:13 +0000 (15:12 -0800)
Currently, when called without -n and -f, git clean issues

fatal: clean.requireForce not set and -n or -f not given; refusing to clean

which leaves the user wondering why force is required when requireForce
is not set. Looking up in git-clean(1) does not help because its
description is wrong.

Change it so that git clean issues

fatal: clean.requireForce defaults to true and -n or -f not given; refusing to clean

in this situation (and "...set to true..." when it is set) which makes
it clearer that an unset config means true here, and adjust the
documentation.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-clean.txt
builtin-clean.c

index 335c885bb7b9fbf373400f44bcdca82f6b3e9958..a81cb6c28050e83778f11f2957d3489f50fa6004 100644 (file)
@@ -33,8 +33,8 @@ OPTIONS
 
 -f::
 --force::
-       If the git configuration specifies clean.requireForce as true,
-       'git clean' will refuse to run unless given -f or -n.
+       If the git configuration variable clean.requireForce is not set
+       to false, 'git clean' will refuse to run unless given -f or -n.
 
 -n::
 --dry-run::
index 3a70fa81bdd8f0e087476560f7c2f668a3cda0ea..fac64e6cd3717dfffb0f54124de9545f7cdc391a 100644 (file)
@@ -67,8 +67,8 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
                die("-x and -X cannot be used together");
 
        if (!show_only && !force)
-               die("clean.requireForce%s set and -n or -f not given; "
-                   "refusing to clean", config_set ? "" : " not");
+               die("clean.requireForce %s to true and neither -n nor -f given; "
+                   "refusing to clean", config_set ? "set" : "defaults");
 
        if (force > 1)
                rm_flags = 0;