Closed przemoc closed 8 years ago
It seems that maybe some reports I've seen on internet were wrong. I've tested only pre-commit hook and it works fine with git v2.1.4 (debian jessie). The only nitpick would be that if .metadata
wasn't there before committing, then it's marked as untracked during commit message editting, but it lands into the commit anyway.
Maybe I have to try more recent git version to see that this hook script fails.
I tested them with 2.3.10 and tried a number of scenarios without a problem. The only minor annoyance I found was in the case where a commit was aborted (e.g. by not entering a comment), which caused the .metadata file to be updated and added to the index but not committed. It's annoying because if you then immediately try to checkout a different version of the code (any version) you get the error:
error: Your local changes to the following files would be overwritten by checkout:
.metadata
It's easy to recover just by deleting the .metadata file, and I wouldn't call this much of an issue.
As I was mostly out-of-git metastore user myself, I haven't caught it, but apparently pre-commit hook's
git add .metadata
doesn't do what one may think it does, i.e. this example script is in fact broken with non-ancient git versions. Thus it has to be thoroughly tested and fixed along the way.