On February 20, 2019 10:41:51 AM GMT+01:00, Duy Nguyen <pclouds@xxxxxxxxx> wrote: >Making "git checkout/merge" abort while it's working before breaks >scripts. Change is always a trade-off. We should not reject change without considering the merits. Once we agree on the desired state, we can think about the migration strategy. >And requiring to mark trashable files manually duplicates a >lot of ignore patterns. Have a look at any .gitignore file, the >majority of them is for discardable files because "ignored" class was >created with those in mind (*.o and friends). So now you would need to >add more or less the same set of ignore rules in .gitattributes to >mark them trashable, and gitignore/gitattributes rules are not exactly >compatible, you can't just blindly copy them over. Every time you add >one more .gitignore rule, there's a good chance you need to add a >similar rule for trashable attribute. I agree that ignored precious files are typically a small subset of the ignore files. Maintaining separate rules for ignored files and for trashable files would result in a lot of duplication. On the other hand, how frequently do we really have to trash ignored files? Trashing a file should only be necessary if a tracked file overwrites an ignored file. When does this happen? I don't think it will happen for *.o files. So in most cases, there is simply no need to specify which files are precious. The default could simply be that all files are precious. To support more complex use cases, we could specify precious files in addition to ignored files. Only if we specify precious files (and/or enable the ignored-are-trashable config option on a repository level), all other files become trashable. Functionally this is equivalent the newbie option which you suggest, but I think it is not an issue of newbie vs experienced users but an issue of common vs special use cases. >Maybe we just add a new "newbie" config knob and turn on the safety >nets on. Leave the knob on by default. And I will turn it off in my >~/.gitconfig as soon as it's real.