[Resending as it did not seem to get through to the list last time] Hi Elijah On 27/09/2021 17:33, Elijah Newren via GitGitGadget wrote:
We have multiple codepaths that delete untracked files/directories but shouldn't. There are also some codepaths where we delete untracked files/directories intentionally (based on mailing list discussion), but where that intent is not documented. We also have some codepaths that preserve ignored files, which shouldn't. Fix the documentation, add several new (mostly failing) testcases, fix some of the new testcases, and add comments about some potential remaining problems. (I found these as a side-effect of looking at [1], though [2] pointed out one explicitly while I was working on it.) Note that I'm using Junio's declaration about checkout -f and reset --hard (and also presuming that since read-tree --reset is porcelain that its behavior should be left alone)[3] in this series.
I've had a read through and I don't have any specific comments, I like the way you have simplified adding the standard excludes for callers and making the existing value of reset invalid when converting to an enum. I think there is a small risk someone will complain about read-tree changing how it handles ignored files, but hopefully everyone was just passing ".gitignore" to --exclude-per-directory and they wont mind 'read-tree -m -u' removing ignored files now.
Best Wishes Phillip