Interesting chasing-my-own-tail moment: I just did a
git pull in the projects directory of one server to bring it in sync with the other, which changed some files, which triggered the project change event, which then tried to add/commit everything!
In this particular case it was okay since the projects directory was in sync with a commit (i.e. the add/commit both did nothing). But, I’m pretty sure there would be some very ugly consequences in many other cases…
Let this be a warning to any other people following this path: don’t enable a project change script like I have above if you will be doing any work in the projects directory that could ever possibly leave the git repo in an incomplete state. I can’t imagine the chaos this would cause if I were doing a
git merge in the projects directory and hit a conflict.
I imagine a reasonable solution would be a lockout memory tag that indicates that git add/commit should be disabled for the time being. A developer would turn it on before doing git work on the command line, and the script above would do nothing when it was set. This would allow the setting to be changed without changing the project properties.