git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Nadav GoldsteinNext: Eric Sunshine
Message 13 of 15 in “stash: added safety flag for stash clear subcommand”
  1. stash: added safety flag for stash clear subcommandNadav Goldstein via GitGitGadget, May 15, 2022
  2. Junio C HamanoMay 16, 2022
  3. 0/2 stash clear: added safety flag for stash clear subcommandNadav Goldstein via GitGitGadget, May 23, 2022
  4. 1/2 add-menu: added add-menu to lib objectsNadav Goldstein via GitGitGadget, May 23, 2022
  5. Derrick StoleeMay 23, 2022
  6. Junio C HamanoMay 23, 2022
  7. 2/2 clean: refector to the interactive part of cleanNadav Goldstein via GitGitGadget, May 23, 2022
  8. Derrick StoleeMay 23, 2022
  9. Derrick StoleeMay 23, 2022
  10. Introduced force flag to the git stash clear subcommand.Nadav Goldstein via GitGitGadget, Jun 20, 2023
  11. Junio C HamanoJun 20, 2023
  12. Nadav GoldsteinJun 20, 2023
  13. Junio C HamanoJun 20, 2023
  14. Eric SunshineJun 20, 2023
  15. Nadav GoldsteinJun 20, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.