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.

  1. cd ~git/repositories/XXXX/hooks
  2. locate post-receive-email
  3. cp YYY/post-receive-email .
  4. emacs post-receieve-email
  5. change recipients=YOUR MAILING LIST
  6. change
    describe=$(git describe $rev 2>/dev/null)
    to
    describe=$(git log -1 —pretty=%s $rev)
  7. change 
    Subject: ${emailprefix}$projectdesc $refname_type $short_refname ${change_type}d. $describe
    to
    Subject: [${emailprefix}$projectdesc $short_refname] $describe
  8. change emailprefix=”
  9. below “via $rev”, add             echo “https://YOUR_CGIT_SERVER/cgit/REPO/commit/?id=$rev”
  10. emacs post-receive
  11. uncomment sourcing of post-receive-email and include fully path to your new post-receive-email file
  12. if committing is really slow / hangs, uninstall sendmail, install postfix
blog comments powered by Disqus

Notes

  1. codeshal posted this