On Friday, 19 September 2014 07:16:50 UTC+2, vineet naik wrote: > > Hi, > > We use a commit-msg hook to add ChangeId (for gerrit) in each commit > msg. Now I want to ensure that it's also added in merge and squash > commits created as a result of `git subtree ... --squash`. So I tried > using `prepare-commit-msg` hook but it doesn't seem to get called at > the time of merging subtree commits with the --squash option. What is > the right way to do this? > > Thanks, > Vineet > > First make sure the file's name is correct (it should be exactly *prepare-commit-msg*) and that it has execute permissions: simplest errors are the most frequent ones. Then try returning a non-zero exit code at the beginning of the hook:
*.git/hooks/prepare-commit-msg* # Interrupt exit 1 If it interrupts the merge, then it means the hook is correctly running and the problem lies in the hook's instructions; if it doesn't then the problem lies elsewhere. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.