Re: what should "git clean -n -f [-d] [-x] <pattern>" do?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2024, 18:34 UTC
- Message-ID
- <xmqqsf2nnbkj.fsf@gitster.g>
- In-Reply-To
- <87a5ow9jb4.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
> Then how does one figure what "git clean -f -f" will do without actually > doing it?
I think whoever came up with the bright idea of forcing twice somehow does a totally different thing from forcing once should be shot, twice ;-) It does not mesh well with the idea behind the clean.requireForce setting to make you explicitly choose either '-f' or '-n' to express your intent.
I wonder how feasible is it to deprecate that misfeature introduced with a0f4afbe (clean: require double -f options to nuke nested git repository and work tree, 2009-06-30) and migrate its users (which is marked as "This is rarely what the user wants") to a new option, say, --nested-repo-too so that the "dry-run" version of the invocations become
git clean -n
git clean -n --nested-repo-tooand you can substitute "-n" with "-f" to actually perform it?
Anybody care to come up with a sensible migration plan?
Thanks.