refactor pre-commit.git.sh to make logic clear