我知道这里已经有非常相似的问题,但它们没有解决我的问题。也许有些地方我没有理解清楚。
这是fitnesse的提交历史记录的一部分(https://github.com/unclebob/fitnesse/):
* | | | | | | | | | | | | | | | fa86be8 Avoid possible issue when using CachingPage under heavy memory load.
|/ / / / / / / / / / / / / / /
* | | | | | | | | | | | | | | 7b4a07a Merge pull request #256 from barredijkstra/fitnesse_issue_250
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | ecf5891 Fixed test checking for OS specific exception message.
| * | | | | | | | | | | | | | | 082236e Added rendering of cause exceptions. Fix for unclebob/fitnesse#250
* | | | | | | | | | | | | | | | a92b37f Merge pull request #243 from amolenaar/fix/243-hash-table-rendering
我想要在两个提交哈希之间的提交列表。在这种情况下,我想要 ecf5891
和 7b4a07a
之间的提交,并期望结果为:
ecf5891
7b4a07a
到目前为止,我一直在使用git rev-list commit_hash_from_here^..commit_hash_up_to_here
命令,并且在线性历史的情况下运行良好。然而,在这种情况下,我得到了更多的提交记录。
我尝试了这个方法,它像预期的那样工作:
git log --since='<date ecf5891>' --until='<date 7b4a07a>'
(我手动搜索了这2个日期)。
一种可能的解决方案是获取这2个日期并执行操作,但我认为应该有更好的方法。
编辑:
7b4a07a
的父提交分别为 ecf5891
和 a92b37f
。到目前为止,如果我想从 ecf5891
走到 7b4a07a
,那么方案就可以正常工作,但如果我想从 a92b37f
走到 7b4a07a
,我希望能够得到:
7b4a07a
ecf5891
082236e
a92b37f
但是我不明白a92b37f
git log --oneline --ancestry-path commit1~1..commit2
这样可以精确地查看我所拥有的两个提交哈希之间的所有内容。谢谢! - Hoonerbean