Search code examples
gitformattingdiffgit-post-receive

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?


Solution

  • 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.