Git:接收电子邮件后挂钩显示 html 格式的颜色差异?
我使用 Git 的接收后电子邮件挂钩发送了一份差异电子邮件(感谢 这篇文章),但它发送的电子邮件只是纯文本。我想要一些色彩更丰富、格式更好的大东西。
是否有一个脚本或其他东西可以使用 post-receive 挂钩运行,它将发送一封格式良好的差异电子邮件而不是纯文本电子邮件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用语法荧光笔(例如 Pygments)格式化代码。使用他们的 命令行 工具应该很容易将输出传输到可以嵌入的 html 文档中电子邮件的正文。我想你可以做类似的事情 这个 但将该命令替换为您的自定义 Pygments 命令。
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.
您可以尝试(我自己没有测试过)另一个接收电子邮件挂钩:
git-hook-update-notify-email
(基于 ruby,也在 rubyforge.org 中引用)
You can try (not tested myself) this other post-receive email hook:
git-hook-update-notify-email
(ruby-based, also referenced in rubyforge.org)