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

Re: [PATCH] clean: confirm before cleaning files and directories

From
Jiang Xin <worldhello.net@gmail.com>
Date
Apr 26, 2013, 08:41 UTC
Message-ID
<CANYiYbFzEoEgJzKsB_hiKNy2JCxaTDX30wXNjnzComOzJJF_cw@mail.gmail.com>
In-Reply-To
<vpqfvydhfbx.fsf@grenoble-inp.fr>
2013/4/26 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Show 12 quoted lines
>
> Jiang Xin <worldhello.net@gmail.com> writes:
>
> >  * run `git clean` in interactive sessions,
> >  * not a dry run,
> >  * and not quiet.
>
> Err, does this mean I'll have:
>
> $ git clean
> fatal: clean.requireForce defaults to true and neither -n nor -f given; refusing to clean
> $ git clean --force

( you omit something, because nothing to clean won't trigger this confirm dialog)

> Are you sure [y/n]?
>
> An optional confirmation dialog seems interesting, but activating it by
> default even with --force seems really weird.

I don't know how many programmers had been bitten by runing `git clean -fdx`, but I bet there were some. I think safety should be put to the 1st place. It is because "clean.requireForce" defaults to true, all people trend to run 'git clean' with the '--force/-f' option.

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)
any opinions?
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/

-- 蒋鑫

北京群英汇信息技术有限公司 邮件: worldhello.net@gmail.com 网址: http://www.ossxp.com/ 博客: http://www.worldhello.net/ 微博: http://weibo.com/gotgit/ 电话: 18601196889

Previous: Matthieu MoyNext: Matthieu Moy
Message 3 of 30 in “clean: confirm before cleaning files and directories”
  1. clean: confirm before cleaning files and directoriesJiang Xin, Apr 26, 2013
  2. Matthieu MoyApr 26, 2013
  3. Jiang XinApr 26, 2013
  4. Matthieu MoyApr 26, 2013
  5. Jiang XinApr 26, 2013
  6. Thomas RastApr 26, 2013
  7. Junio C HamanoApr 26, 2013
  8. Matthieu MoyApr 26, 2013
  9. Junio C HamanoApr 26, 2013
  10. Junio C HamanoApr 26, 2013
  11. Jiang XinApr 27, 2013
  12. Add support for -i/--interactive to git-cleanJiang Xin, Apr 27, 2013
  13. Matthieu MoyApr 27, 2013
  14. Junio C HamanoApr 27, 2013
  15. Eric SunshineApr 28, 2013
  16. Matthieu MoyApr 29, 2013
  17. clean: Introduce -z for machine readable outputMichael J Gruber, Apr 29, 2013
  18. Matthieu MoyApr 29, 2013
  19. Jiang XinApr 29, 2013
  20. Add support for -i/--interactive to git-cleanJiang Xin, Apr 30, 2013
  21. Matthieu MoyMay 1, 2013
  22. 1/3 Add support for -i/--interactive to git-cleanJiang Xin, May 2, 2013
  23. 2/3 Show items of interactive git-clean in columnsJiang Xin, May 2, 2013
  24. 3/3 Add colors to interactive git-cleanJiang Xin, May 2, 2013
  25. Matthieu MoyMay 2, 2013
  26. Jiang XinMay 3, 2013
  27. Matthieu MoyMay 2, 2013
  28. Jiang XinMay 3, 2013
  29. Matthieu MoyMay 3, 2013
  30. Jiang XinMay 2, 2013

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.