Tweaking the git post-receieve-email hook
For whatever reason, Git’s post-receive email hook is a hassle to configure, and ugly. How we do it.
- cd ~git/repositories/XXXX/hooks
- locate post-receive-email
- cp YYY/post-receive-email .
- emacs post-receieve-email
- change recipients=YOUR MAILING LIST
- change
describe=$(git describe $rev 2>/dev/null)
to
describe=$(git log -1 —pretty=%s $rev) - change
Subject: ${emailprefix}$projectdesc $refname_type $short_refname ${change_type}d. $describe
to
Subject: [${emailprefix}$projectdesc $short_refname] $describe - change emailprefix=”
- below “via $rev”, add echo “https://YOUR_CGIT_SERVER/cgit/REPO/commit/?id=$rev”
- emacs post-receive
- uncomment sourcing of post-receive-email and include fully path to your new post-receive-email file
- if committing is really slow / hangs, uninstall sendmail, install postfix