我想列出两个不同版本之间每次提交的所有提交和更改。
我有两个不同的版本:
A:
<project name="gecko.git" path="gecko" remote="mozillaorg" revision="913804d1cc347112fd033df8c18e683db074791f" upstream="v1.4"/>
B:
<project name="gecko.git" path="gecko" remote="mozillaorg" revision="ef52f8028b3f60190f78801ac5dbd879f836a498" upstream="v1.4"/>
现在我可以使用
git diff 913804d1cc347112fd033df8c18e683db074791f ef52f8028b3f60190f78801ac5dbd879f836a498
两个显示 A 和 B 之间的所有更改,如:
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 2f574d3..3274ceb 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
- <project name="gaia.git" path="gaia" remote="mozillaorg" revision="c0b571522702f4d9fb6aba10300e9cbc55c2d084"/>
+ <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ce6c3d8fbd123dc65e8d2dd1f90403e24fa36dfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="81e894545b87ea2cf9e78f56a2cd1d2a5adc7a25"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index d4038f1..a6520b6 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
- <project name="gaia" path="gaia" remote="mozillaorg" revision="c0b571522702f4d9fb6aba10300e9cbc55c2d084"/>
+ <project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c3d8fbd123dc65e8d2dd1f90403e24fa36dfe"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="81e894545b87ea2cf9e78f56a2cd1d2a5adc7a25"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="7beaabe1187b688ef560607912577c614a038533"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a4baf82a131a7853cf7e7f9cf74253927b2f355"/>
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 59429f5..a727976 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
- <project name="gaia" path="gaia" remote="mozillaorg" revision="c0b571522702f4d9fb6aba10300e9cbc55c2d084"/>
+ <project name="gaia" path="gaia" remote="mozillaorg" revision="ce6c3d8fbd123dc65e8d2dd1f90403e24fa36dfe"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="81e894545b87ea2cf9e78f56a2cd1d2a5adc7a25"/>
使用上面的输出我无法确定哪个更改与哪个提交有关,所以我很难缩小某些特定的错误。
我的问题是如何列出两个版本之间每次提交的所有提交和更改,例如
commit f3001d8f7099d582916b96340a8e2f0d19930c01
<Changes in this commit>
commit 185711685900f71dea5cdd17ae4a0c02847c68d2
<Changes in this commit>
commit af7ca17248731d6b98772b0ab051d918fb7f9b84
<Changes in this commit>
答案 0 :(得分:3)
也许这就是你想要的:
git log -p 913804..ef52f8
git
将正确理解哈希给出足够的字符以使它们毫不含糊。
答案 1 :(得分:2)
您可以将提交范围传递给git show
:
git show first_commit..last_commit
如果你想做一些更复杂的事情,有一个关于如何在这个链接中使用提交范围的很好的解释:http://git-scm.com/book/ch6-1.html#Commit-Ranges