libgit2 / libgit2/pygit2

Walker?

未关闭
#1,055 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
1.7k
派生
408
平均合并
2 天 57 分钟
30 天内合并 PR
7

描述

https://www.pygit2.org/commit_log.html describes a Walker object, but does not explain how to get one or how to use it. Are we to infer that the the iterator produced by the call to Repository.walk() immediately above is an object of type Walker? When I debug that seems to be the case.

For example, if heads is a list of heads and w a Walker, will

for h in heads:
    w.push(h)
    for cmt in w:
        do_stuff(cmt)

call do_stuff exactly once (i.e., the walker remembers and ignores commits already visited on later calls) for each commit in my repository that is reachable from any head?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

https://www.pygit2.org/commit_log.html 上的 commit_log 文档和 Repository.walk() 的描述开始。明确如何获取和使用 Walker,包括迭代是否会在重复调用 push 之间保留已访问的 commit。完成的标准是:读者无需自行推断,页面就能说明示例的行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, python
领域
documentation
Issue 类型
文档
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。