Skip to content

Blame / 逐行追溯视图 #13

Description

@zjywill

现状

没有 blame。已有的基础:

  • GitClient.fileHistory(_:limit:)log --followSources/TheGit/Core/GitClient.swift:62
  • FileHistoryView.swiftFileDiffView.swift 已有文件级视图

目标

文件视图里加一个 blame / annotate 模式:每行左侧显示最后修改它的 commit(短 SHA + 作者 + 日期),点击跳到该 commit。

实现要点

  • git blame --porcelain <path> 解析。porcelain 格式会对重复的 commit 省略元数据,需要维护一个 SHA → 作者/日期的表。
  • 复用现有 AvatarStore 显示作者头像。
  • 支持 blame 到某个历史版本(git blame <rev> -- <path>),以及「跳到上一个版本再 blame」(blame 链式追溯)。

优先级

P1 —— 性价比最高的一个:已有的 fileHistory + FileDiffView 基础设施能直接复用,Sourcetree 有这个功能。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions