I would like to check commit message before git commit. I use pre-commit hook to do that, but couldn\'t find the way to get commit message in .git/pre-commit script. How cou
You can do the following in a pre-receive
hook (for server side) using Python, and that will display the revision information.
import sys
import subprocess
old, new, branch = sys.stdin.read().split()
proc = subprocess.Popen(["git", "rev-list", "--oneline","--first-parent" , "%s..%s" %(old, new)], stdout=subprocess.PIPE)
commitMessage=str(proc.stdout.readlines()[0])