Phillip Wood <phillip.wood123@xxxxxxxxx> writes: > One thought I had was that we could abuse the comment syntax to > annotate paths something like > > #(keep) > /my-precious-file > > would prevent /my-precious-file from being deleted by git clean (and > hopefully unpack-trees()[1]). It means that older versions of git > would treat the file as ignored. If we ever want more than one > annotation per path we could separate them with commas > > #(keep,something-else) > /my-file > > Strictly speaking it is a backward incompatible change but I doubt > there are many people using comments like that. ;-) If "#(" feels a bit too generic, that part can be bikeshed. I might find some example use cases why we shouldn't later, but offhand, the idea of (ab)using the comment is a very good idea.