Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: post-receive email hook to show an html formatted color diff?

I've got a diff e-mail sending using Git's post-receive e-mail hook (thanks to this SO post) but the e-mail that it sends is just plain text. I'd like something a big more colorful and well formatted.

Is there a script or something I can run using the post-receive hook that will send a nicely formatted diff e-mail instead of the plain text one?

like image 390
cmcculloh Avatar asked Jul 12 '10 21:07

cmcculloh


2 Answers

You can format your code using a syntax highlighter like Pygments. Using their commandline tool it should be easy to pipe your output into an html doc which can be embedded in the body of an email. I would figure you could do something like this but replace the command with your custom Pygments command.

like image 167
dcolish Avatar answered Oct 06 '22 00:10

dcolish


You can try (not tested myself) this other post-receive email hook:

git-hook-update-notify-email

script for colorized emails on GIT commits. Use it in the "update" hook.

(ruby-based, also referenced in rubyforge.org)

like image 43
VonC Avatar answered Oct 06 '22 01:10

VonC