Anchor links to specific line(s) in commit diffs

未关闭
#8 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
git, go
领域
web-dev

调研方向

定位 commit diff 渲染的入口点,并将其与普通文件现有的锚点行为进行比较。跟踪 URL 片段的生成方式,然后验证单行片段和行范围片段是否能定位 issue 示例中所示的对应 diff 行。

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

描述

feature

Would be useful to have anchors for lines in commits diffs (in addition to already existing anchors in browsing "regular" files), for example like it is done on GitHub:

https://github.com/antonmedv/gitmal/commit/2d31323ad174fb2f7aa7312009814118784a45b8#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R78

So here the #diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R78 part is an anchor to a specific line in the diff.

Or like this for a range of lines:

https://github.com/antonmedv/gitmal/commit/2d31323ad174fb2f7aa7312009814118784a45b8#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R78-R80

so it's the same but plus -R80 part.

主要语言
Go
星标
1.3k
派生
50
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

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

antonmedv/gitmal 的其他 Issue

查看 antonmedv/gitmal 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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