怎样在git send-email发送的patch前添加自己的注释
先用git把你的patch生成一个提交,提交中添加你的修改的描述。然后,git-format-patch生成这个patch. 再用git-send-email发送这个patch.流程:1. 修改代码,测试。2. git commit. 生成一个提交,加入patch描述。3. git format-patch -1. 生成patch, -1表示从HEAD开始生成一个patch, 也就是你刚commit的patch.4. git send-email \u0026lt;patch\u0026gt;
■网友
git commit message的第一行是邮件标题,第二行后是邮件正文。另外,早期版本在生成邮件的时候有个bug,我不清楚现在改了没有(我曾经提交过patch被要求进一步修改,然后我没时间就放弃了),因此建议在第一行和第二行之间空一行(git用空行来区分paragraph),可以避开潜在的bug。
■网友
简单来说,patch文件的three-dash分界上方是commit msg,git am的时候进入代码库历史中;下方的内容一般在开源社区对不想加入commit msg的信息进行说明。两种办法编辑,一种是git format-patch之后手动编辑文件,另外一种使用--annotate选项。ref:Sometimes it\u0026#39;s convenient to annotate patches with some notes that are not meant to be included in the commit message. For example, one might want to write "I\u0026#39;m not sure if this should be committed yet, because..." in a patch, but the text doesn\u0026#39;t make sense in the commit message. Such messages can be written below the three dashes "---" that are in every patch after the commit message. Use the --annotate option with git send-email to be able to edit the mails before they are sent.
推荐阅读
- 聪明人养花,这3种“花”怎样也要养一盆,每年能省不少医药费
- 互联网怎样解决“家政服务上门速度慢”的问题
- 怎样看待从1月8号起,QQ钱包开始提现收费
- 银行it人怎样转型
- 汽车|冬天怎样让车内温度快速升高?座椅加热的最佳使用方式二,外循环的作用总结
- 怎样进入通信行业
- 怎样评价扶他柠檬茶的小说《云养汉》的结尾
- 怎样成为一名合格的Python程序员?
- 怎样评价华为、诺基亚、中兴中标中国移动高端路由交换设备扩容集采
- 怎样评价类似前橙会、百老汇、南极圈这样类型的离职帮抱团,对企业的积极意义和消极意义
