Re: [PATCH v3] Introduced force flag to the git stash clear subcommand.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2023, 20:46 UTC
- Message-ID
- <xmqqpm5plv41.fsf@gitster.g>
- In-Reply-To
- <1540e884-08c7-922e-1fd9-65616268c1c9@gmail.com>
Nadav Goldstein <nadav.goldstein96@gmail.com> writes:
> I see, but isn't the same argument apply for git clean? if not adding > the force flag, the same message as I wrote appear in git clean (I > copied it from there), and it will exit without any other information, > hence given your argument, running git clean is also not very useful.
The thing is that "git clean" by default forces people to choose between "-f" and "-n" to force people to understand the issue. And once they understand the issue, they'd learn to run "clean -n" first, which lets them see what would be removed, before they run "clean -f". Does your "stash clear" work the same way? I do not think so.
If there is "stash clear --dry-run" that runs "stash list", it might be similar, but not similar enough. I wonder if "stash clear", when stashClear.requireForce is set to true and unless "--force" is given, should do "stash list" and then error out. I dunno.