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

2

12

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?

Laocoon answered 12/7, 2010 at 21:6 Comment(0)
E
5

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.

Engineering answered 16/7, 2010 at 4:21 Comment(2)
This was the way I ended up doing it. Hopefully I'll get around to posting my full solution as it was not very easy to figure out, but this pointed me in the right direction... Thanks!Laocoon
Sure, here it is: blog.chomperstomp.com/…Laocoon
D
2

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)

Derange answered 16/7, 2010 at 4:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.