在这个问题上找不到关于 git docs 的任何解释:
如果我创建一个带有一些虚拟差异的虚拟提交,我在运行时会得到一个正常的补丁
git format-patch -1 -o outgoing/ -p -k
但如果最后一次提交是空提交,则由
git commit --allow-empty "Some commit message"
那么格式补丁的输出将是一个空补丁。如果第一种情况产生这样的结果:
From 08cfdb2994554d834b89309ca96d9bf513e26a90 Mon Sep 17 00:00:00 2001
From: User <mail@example.com>
Date: Fri, 8 Jan 2016 12:44:57 +0000
Subject: dummy commit
diff --git a/lol.txt b/lol.txt
new file mode 100644
index 0000000..f944b38
--- /dev/null
+++ b/lol.txt
@@ -0,0 +1 @@
+:)
--
2.5.4 (Apple Git-61)
那么第二种情况不应该产生这样的东西吗?
From 2d486f25c48780e2e132047e681929fcccb7e60c Mon Sep 17 00:00:00 2001
From: User <mail@example.com>
Date: Fri Jan 8 12:43:55 2016 +0000
Subject: Some commit message
2.5.4 (Apple Git-61)