我们在工作流程中使用 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/