Re: [PATCH] clean: confirm before cleaning files and directories
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Apr 26, 2013, 08:51 UTC
- Message-ID
- <vpqwqrpfzez.fsf@grenoble-inp.fr>
- In-Reply-To
- <CANYiYbFzEoEgJzKsB_hiKNy2JCxaTDX30wXNjnzComOzJJF_cw@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 6 quoted lines
> Maybe we can do like this: > > 1. Set the default value of 'clean.requireForce' to false. > 2. Show a error message and do nothing, if there is not 'clean.requireForce' > setting, but the user called with a '--force' flag. > ( like a transition for the change of push.default in git 2.0)
Perhaps introducing a new value for 'clean.requireForce':
$ git config --global clean.requireForce ask $ git clean will remove ... are you sure [y/N]?
The error message when clean.requireForce is unset and --force is not given could point the user to clean.requireForce=ask.
Then, maybe, later, this could become the default. But I tend to like the non-interactive nature of most Git commands, so I'm a bit reluctant here. My way of doing the confirmation dialog is
$ git clean -n would remove ... $ git clean -f
-- Matthieu Moy http://www-verimag.imag.fr/~moy/