Prevent to Git Hook `post-commit` execute for submodules -


can somehow prevent post-commit hook being called when commit in submodule? i'm using hook automatically commit submodule changes main project commit message , i'm getting in "infinity loop".

file: post-commit

#!/bin/sh if git diff-index --quiet head --;     echo no submodule changes else     git submodule foreach git add . ;     git submodule foreach git commit -am "`cat .git/commit_editmsg`" fi 

thanks.

i not able fix running command each submodule didn't face problem anymore:

git submodule foreach "git diff-index --quiet head -- || (git add . ; git commit -am \"`cat .git/commit_editmsg`\" || :)" 

Comments