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

Re: [RFC PATCH] Introduce "precious" file concept

From
Per Lundberg <per.lundberg@hibox.tv>
Date
Nov 27, 2018, 14:50 UTC
Message-ID
<56ffc52f-644c-2c1d-6a16-c1005b064385@hibox.tv>
In-Reply-To
<CA+P7+xri1=peNpEiZCE802HwCXhojyp2BDvOR+6BBSoRtsZyzA@mail.gmail.com>
On 11/27/18 2:55 PM, Jacob Keller wrote:
> Personally, I would rather err on the side which requires the least
> interaction from users to avoid silently clobbering an ignored file.
> 
 > [...]
> 
> I don't like the idea of precious because it means people have to know
> and remember to opt in, and it's quite possible they will not do so
> until after they've lost real data.

I agree strongly with this personally; if we must choose between "might break automation" and "might delete non-garbage files", I would say the former is the lesser evil of the two.

But, if I had 10 000 000 servers set up using automated scripts that would break because of this, I might think differently. Quite likely so, in fact.

What are these automation scenarios _more specifically_? Junio or Brian, would you care to elaborate? Is it for build servers where you want "git clean -dfx" to always reset the working copy to a pristine state or are we talking about some other scenarios?

> I'd only have trashable apply in the case where it was implicit. i.e.
> git clean -fdx would still delete them, as this is an explicit
> operation that (hopefully?) users know will delete data.
This is one of the tougher calls, unfortunately.

If I was a user (which I am), and I was typing "git clean -dfx", what would I expect?

The help text (currently) states "-x   remove ignored files, too".

Would it be safe to assume that people would understand that "ignored _does not_ mean trashable when doing "git checkout some-ref" BUT it _does_ mean trashable in the "git clean -dfx" context"? I'm not so certain. It would be one of those perceived inconsistencies that would make people scream in anger because they _presumed_ that with the new "trashable" concept, "git clean -dfx" would no longer hit them in the leg.

And the other way around: if we change "git clean -dfx" to _not_ treat "ignored == trashable", it is likely to "hose automation" as it has been previously stated. People who might be using this syntax and _want_ it to remove ignored files would be upset, and rightfully so.

So in my POV, it's a tough decision between two, less-than-optimal alternatives.

But I would perhaps be able to live with the current semantics for "git clean -dfx" _as long as we update the help text_ so that "-x" indicates more clearly that non-trashable files can be deleted. It doesn't make things _worse_ than they currently are and if this is what it takes to get the trashable concept implemented and accepted by the community, it's a compromise I'd be willing to make. -- Per Lundberg

Previous: Jacob KellerNext: brian m. carlson
Message 31 of 40 in “Introduce "precious" file concept”
  1. Introduce "precious" file conceptNguyễn Thái Ngọc Duy, Nov 11, 2018
  2. Bert WesargNov 11, 2018
  3. Ævar Arnfjörð BjarmasonNov 11, 2018
  4. Ævar Arnfjörð BjarmasonNov 11, 2018
  5. Duy NguyenNov 12, 2018
  6. Duy NguyenNov 11, 2018
  7. Ævar Arnfjörð BjarmasonNov 11, 2018
  8. Per LundbergNov 12, 2018
  9. Matthieu MoyNov 12, 2018
  10. Ævar Arnfjörð BjarmasonNov 12, 2018
  11. Junio C HamanoNov 12, 2018
  12. Ævar Arnfjörð BjarmasonNov 12, 2018
  13. Junio C HamanoNov 12, 2018
  14. Duy NguyenNov 12, 2018
  15. brian m. carlsonNov 12, 2018
  16. Per LundbergNov 26, 2018
  17. Ævar Arnfjörð BjarmasonNov 26, 2018
  18. Junio C HamanoNov 26, 2018
  19. Ævar Arnfjörð BjarmasonNov 27, 2018
  20. Junio C HamanoNov 28, 2018
  21. Ævar Arnfjörð BjarmasonNov 28, 2018
  22. Junio C HamanoNov 29, 2018
  23. Duy NguyenDec 1, 2018
  24. Duy NguyenNov 26, 2018
  25. Ævar Arnfjörð BjarmasonNov 26, 2018
  26. Duy NguyenNov 26, 2018
  27. Ævar Arnfjörð BjarmasonNov 26, 2018
  28. Duy NguyenNov 26, 2018
  29. Per LundbergNov 27, 2018
  30. Jacob KellerNov 27, 2018
  31. Per LundbergNov 27, 2018
  32. brian m. carlsonNov 28, 2018
  33. Per LundbergNov 28, 2018
  34. Duy NguyenNov 27, 2018
  35. Duy NguyenDec 6, 2018
  36. Eckhard MaaßNov 26, 2018
  37. Junio C HamanoNov 11, 2018
  38. 0/2 Precios files round twoNguyễn Thái Ngọc Duy, Nov 26, 2018
  39. 1/2 Introduce "precious" file conceptNguyễn Thái Ngọc Duy, Nov 26, 2018
  40. 2/2 unpack-trees: support core.allIgnoredFilesArePreciousWhenMergingNguyễn Thái Ngọc Duy, Nov 26, 2018

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.