小编nul*_*ull的帖子

使用 GitPython 反向读取提交

有没有一种方法可以使用 GitPython 库反向迭代提交,即从最旧的到最新的,其方式类似于:

>>> from git import Repo
>>> repo = Repo('/path/to/repo')
>>> for commit in reversed(repo.iter_commits()):
...     print commit
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument to reversed() must be a sequence
Run Code Online (Sandbox Code Playgroud)

不必首先将所有内容都包含在内存中,因为我的情况是处理大量提交(例如linux内核)?

python gitpython

2
推荐指数
1
解决办法
2766
查看次数

标签 统计

gitpython ×1

python ×1