Git:接收电子邮件后挂钩显示 html 格式的颜色差异?

发布于 2024-09-09 03:38:20 字数 260 浏览 11 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

碍人泪离人颜 2024-09-16 03:38:20

您可以使用语法荧光笔(例如 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.

许仙没带伞 2024-09-16 03:38:20

您可以尝试(我自己没有测试过)另一个接收电子邮件挂钩:

git-hook-update-notify-email

GIT 提交的彩色电子邮件脚本。在“更新”挂钩中使用它。

(基于 ruby​​,也在 ruby​​forge.org 中引用

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文