summaryrefslogtreecommitdiff
path: root/git-clean.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-11-01 17:32:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-04 01:54:41 -0800
commit562ca192f94496611583688beb3725603ce51f89 (patch)
tree3f75997bec9232fe760ea1d8a695b9055286d6fc /git-clean.sh
parentRelNotes-1.5.3.5: fix typo (diff)
downloadtgif-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 4491738186..f4965b8391 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