TL; DR: PhpStorm behaves strangely when the pre-commit hook modifies the file.
I have this pre-commit hook that checks for changes in js and css files, and if one of them has been changed, we want the hook to change the configuration file (the file we use to force the cache to reload all browsers of these "files on the client side ") so that changes are included in the commit.
The hook looks like this:
#!/bin/bash
JSCSSCHANGE=`git status|grep -E "(.css|.js)"|wc -l`
if [ $JSCSSCHANGE -ne 0 ]; then
git add .
fi
The fact is that when we pass through the command line or even using SourceTree, it works fine: the file that it modified and included in commit.
But when we do the commit via PhpStorm, after the commit, including the modified file, we remain with the same file, waiting for the commit, with the changed status. The end was excellent, and it included a modification, but we remained with the same file in an altered state.
source
share