应用 Thunderbird 的 git 系列补丁的最简单方法是什么
我有一封邮件,其中包含 N 个附件,格式为 000X-xxxx.patch。我想将所有补丁应用到我的 master 之上,但我希望将所有提交分开,因为原始作者提交了它们。当然包括提交消息。
方法一:打开电子邮件,单击“另存为,xxx.eml”,然后:
git am xxx.eml
结果没问题,但所有内容都被压缩为一次提交。不可接受。
方法2.所有附件都保存在一个目录下,那么:
git am 000*.patch
Patch format detection failed.
git apply 000*.patch
(does nothing)
这个不行。建议?谢谢。
I have a mail with N attachments in the 000X-xxxx.patch format. I would like to apply all the patches on top of my master, but I would like to have all the commits separate, as the original author commited them. Including the commit message of course.
Method 1: Open the email, click Save as, xxx.eml and then:
git am xxx.eml
The result is ok, but everything is squashed into one commit. Not acceptable.
Method 2. All the attachments are saved in a directory, then:
git am 000*.patch
Patch format detection failed.
git apply 000*.patch
(does nothing)
This is not working. Advices? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通读 git am 手册页,看起来提交消息是由主题:行和消息正文组成的,这意味着您将无法重新创建原始序列提交(也就是说,没有办法恢复作者用于每个单独提交的提交消息)...尽管根据手册页, git am 旨在使用内联补丁,没有作为附件包含补丁,所以我很惊讶它是即使在方法 1 中也能做正确的事情。
如果您愿意放弃提交消息,您应该能够将补丁保存到各个文件中,然后按顺序 git apply ... 它们。
Reading through the
git am
man page, it looks like the commit message is formed from the Subject: line and the message body, which means that you're not going to be able to recreate the original sequence of commits (that is, there's no means by which to recover the commit message the author used for each individual commit)...although according to the man page,git am
is meant to work with inline patches, not patches included as attachments, so I'm surprised it's doing the right thing even in method 1.If you're willing to discard the commit messages, you should be able to save the patches to individual files and just
git apply ...
them in sequence.据我所知,Thunderbird 没有一个合理的
同时将多封电子邮件保存为单独文件的方法。你可以
不过,一次保存一个,这对于小型补丁集确实有效。
讽刺的是,我无意中发现了最简单的方法:将 Linux 补丁发送给一位不遵循邮件列表的同事。转发他们
给你自己(作为附件)。
As far as I have been able to find, Thunderbird does not have a sensible
way to save several emails as individual files at the same time. You can
save them one at a time, though, and this does work for small patch sets.
Ironically, I accidentally discovered the easiest way by sending Linux patches to a colleague who doesn't follow the mailing lists. Forward them
To yourself (as attachments).