Re: what should "git clean -n -f [-d] [-x] <pattern>" do?
- From
Sergey Organov <sorganov@gmail.com>
- Date
- Jan 24, 2024, 08:23 UTC
- Message-ID
- <87plxr3zsr.fsf@osv.gnss.ru>
- In-Reply-To
- <xmqqsf2nnbkj.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> 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 agree, yet I see it as another deficiency, in addition to that of -n, and I used it as an example to emphasize the deficiency of -n.
Show 11 quoted lines
> 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-too > > and you can substitute "-n" with "-f" to actually perform it?
Whereas obsoleting second -f in favor of new --nested-repo might be a good idea indeed, I believe it's still a mistake for "dry run" to somehow interfere with -f, sorry.
Thanks, -- Sergey Organov