0

git小技巧(7)——“git format-patch ..

Posted by nanxiao on 八月 28, 2015 in git小技巧 |

git format-patch <rev1>..<rev2>会产生两个commit之间的patch<rev>commit ID)。请看例子:

[root@localhost linux]# git format-patch 9f10e5bf62f7b9937afeee8ff0a491f87438e2a2..571dbbd4d044e11c78bc077acb3ccef4c77b096e
0001-iommu-vt-d-Init-QI-before-root-entry-is-allocated.patch
0002-iommu-vt-d-Make-root-entry-visible-for-hardware-righ.patch
0003-iommu-vt-d-Detect-pre-enabled-translation.patch
0004-iommu-vt-d-Copy-translation-tables-from-old-kernel.patch
0005-iommu-vt-d-Do-not-re-use-domain-ids-from-the-old-ker.patch
0006-iommu-vt-d-Mark-copied-context-entries.patch
0007-iommu-vt-d-Allocate-si_domain-in-init_dmars.patch
0008-iommu-vt-d-Don-t-do-early-domain-assignment-if-kdump.patch
0009-iommu-vt-d-Don-t-copy-translation-tables-if-RTT-bit-.patch
0010-iommu-vt-d-Don-t-disable-translation-prior-to-OS-han.patch
0011-iommu-vt-d-Enable-Translation-only-if-it-was-previou.patch
0012-iommu-vt-d-Move-EIM-detection-to-intel_prepare_irq_r.patch
0013-iommu-vt-d-Move-QI-initializationt-to-intel_setup_ir.patch
0014-iommu-vt-d-Disable-IRQ-remapping-in-intel_prepare_ir.patch
0015-iommu-vt-d-Set-IRTA-in-intel_setup_irq_remapping.patch
0016-iommu-vt-d-Copy-IR-table-from-old-kernel-when-in-kdu.patch
0017-iommu-vt-d-Make-sure-copied-over-IR-entries-are-not-.patch
0018-iommu-vt-d-Don-t-disable-IR-when-it-was-previously-e.patch

但是这个命令不会包含<rev1>这个commit产生的patch。要想包含<rev1>这个commit产生的patch,需要在<rev1>后加上~,代表<rev1>之前的commit。请看例子:

[root@localhost linux]# git format-patch 9f10e5bf62f7b9937afeee8ff0a491f87438e2a2~..571dbbd4d044e11c78bc077acb3ccef4c77b096e
0001-iommu-vt-d-Cleanup-log-messages.patch
0002-iommu-vt-d-Init-QI-before-root-entry-is-allocated.patch
0003-iommu-vt-d-Make-root-entry-visible-for-hardware-righ.patch
0004-iommu-vt-d-Detect-pre-enabled-translation.patch
0005-iommu-vt-d-Copy-translation-tables-from-old-kernel.patch
0006-iommu-vt-d-Do-not-re-use-domain-ids-from-the-old-ker.patch
0007-iommu-vt-d-Mark-copied-context-entries.patch
0008-iommu-vt-d-Allocate-si_domain-in-init_dmars.patch
0009-iommu-vt-d-Don-t-do-early-domain-assignment-if-kdump.patch
0010-iommu-vt-d-Don-t-copy-translation-tables-if-RTT-bit-.patch
0011-iommu-vt-d-Don-t-disable-translation-prior-to-OS-han.patch
0012-iommu-vt-d-Enable-Translation-only-if-it-was-previou.patch
0013-iommu-vt-d-Move-EIM-detection-to-intel_prepare_irq_r.patch
0014-iommu-vt-d-Move-QI-initializationt-to-intel_setup_ir.patch
0015-iommu-vt-d-Disable-IRQ-remapping-in-intel_prepare_ir.patch
0016-iommu-vt-d-Set-IRTA-in-intel_setup_irq_remapping.patch
0017-iommu-vt-d-Copy-IR-table-from-old-kernel-when-in-kdu.patch
0018-iommu-vt-d-Make-sure-copied-over-IR-entries-are-not-.patch
0019-iommu-vt-d-Don-t-disable-IR-when-it-was-previously-e.patch

可以看到多产生了一个patch

标签:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Copyright © 2013-2017 我的站点 All rights reserved.
This site is using the Multi Child-Theme, v2.2, on top of
the Parent-Theme Desk Mess Mirrored, v2.5, from BuyNowShop.com