Can an option be added to unlock a file in such a way that the next time it gets committed, it is automatically re-locked? Or to just have this done for all unlocked files?
It's a common use case to just do one edit / re-generation of a locked file. If you forget to lock it (or a script that was supposed to lock it after modification fails in the middle), you end up with a permanently unlocked file, which can cause ?performance issues downstream, and also ?look odd when missing, lead to multiple copies when present (or risk annex.thin issues), and leave the file open to inadvertent/unintended modification. Also, locking the file manually litters the git log with commits that don't really change repo contents.
Maybe also, an option to auto-unlock the file right after commit? E.g. based on
.gitattributes
. Basically, unlocked files would look locally modified togit
, but if their contents hasn't changed, the modification would just look liketypechange
from symlink to blob. It can actually be useful to see all unlocked files this way.This of course negates the point of v7, but sometimes the v5 model is a better fit.
I think it should be possible for a pre-commit hook to do this.
There are some subtleties to a pre-commit hook changing what's going to be committed, which I was happy to jettison when removing the v5 support. But it should be able to work at least as well as it did in v5.