git - 覆盖 Git-Send-Email to-cmd 选项

标签 git email sendmail

我们在工作流程中使用 git send-email 命令来交付补丁。有一个小脚本可以确定将其交付给哪个维护者(基于编辑了哪些文件),因此我们都使用以下命令将 sendemail.tocmd 选项设置为指向该脚本:

git config --global sendemail.tocmd ~/scripts/git-send-email-to-cmd.sh

当我们想要将代码发送给与通常发送给不同的维护者时,偶尔会出现一些边缘情况。但是,如果我们使用 --to 标志指定该维护者(如下所示),那么电子邮件将同时发送给普通维护者(由脚本选择)和我们指定的维护者。

git send-email --to=maintainer@company.com 0001-*.patch

如果我们想将它发送给指定的维护者,我们能找到的唯一选择是取消设置sendemail.tocmd选项,执行上面的命令,然后在完成后重新设置选项。

是否有一个标志告诉 send-email 绕过正常的 to-cmd?

最佳答案

the only option we've been able to find is to unset the sendemail.tocmd option, execute the command above, and then re-set the option when finished.

通常,您可以使用 -c "config=" git 参数取消设置一个命令的配置:

git -c "sendemail.tocmd=" send-email --to=maintainer@company.com 0001-*.patch

如果不可能,如评论所述,--to-cmd无论如何,选项将优先于 sendemail.tocmd

关于git - 覆盖 Git-Send-Email to-cmd 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34095049/

相关文章:

git:如何在不禁用 safecrlf 的情况下摆脱 "warning: CRLF will be replaced by LF"?

Git描述给不同的标签

ios - 如何在 iOS 中创建 gmail 收件人格式?

email - 最佳实践 : Sending email on behalf of users

node.js - 我应该为我的 node.js 应用程序使用 AWS SES、sendmail 还是设置 SMTP?

Git Checkout 将代码还原为旧提交,如何还原?

android - Git 的 StatSVN 替代品?

php - 发送带有 php 附件的电子邮件

c# - 如何处理 system.net.mail.smtpfailedrecipientsexception 失败的收件人

linux - 如何让 ansible 回答 "yes"到 sendmailconfig 询问的所有内容