aboutsummaryrefslogtreecommitdiff
path: root/git-clean.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-01 17:32:04 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-04 01:54:41 -0800
commit562ca192f94496611583688beb3725603ce51f89 (patch)
tree3f75997bec9232fe760ea1d8a695b9055286d6fc /git-clean.sh
parentee787400de25ed419f40e70698ba35db475b2d61 (diff)
downloadgit-562ca192f94496611583688beb3725603ce51f89.tar.gz
git-562ca192f94496611583688beb3725603ce51f89.tar.xz
clean: require -f to do damage by default
This makes the clean.requireForce configuration default to true. Too many people are burned by typing "git clean" by mistake when they meant to say "make clean". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-clean.sh')
-rwxr-xr-xgit-clean.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-clean.sh b/git-clean.sh
index 449173818..f4965b839 100755
--- a/git-clean.sh
+++ b/git-clean.sh
@@ -20,12 +20,16 @@ require_work_tree
ignored=
ignoredonly=
cleandir=
-disabled="`git config --bool clean.requireForce`"
rmf="rm -f --"
rmrf="rm -rf --"
rm_refuse="echo Not removing"
echo1="echo"
+# requireForce used to default to false but now it defaults to true.
+# IOW, lack of explicit "clean.requireForce = false" is taken as
+# "clean.requireForce = true".
+disabled=$(git config --bool clean.requireForce || echo true)
+
while test $# != 0
do
case "$1" in