feat(commit): 新增 commit +view 单提交详情;README 中英补新命令示例
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ce8db5912e
commit
e225b86e80
10
README.md
10
README.md
|
|
@ -325,9 +325,17 @@ gitlink-cli member +invite-link --owner Gitlink --repo forgeplus --role develope
|
|||
gitlink-cli issue +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# Fetch all pages automatically (works on all paginated list commands:
|
||||
# issue/pr/branch/release/milestone/org/repo/label/member/webhook +list, search +repos/+users)
|
||||
# issue/pr/branch/release/milestone/org/repo/label/member/webhook/tag/commit +list,
|
||||
# issue +comments, repo +watchers/+stargazers/+forks, search +repos/+users)
|
||||
gitlink-cli issue +list --owner Gitlink --repo forgeplus --all
|
||||
|
||||
# Commit history and single commit details
|
||||
gitlink-cli commit +list --owner Gitlink --repo forgeplus --ref develop --all
|
||||
gitlink-cli commit +view --owner Gitlink --repo forgeplus --sha <sha>
|
||||
|
||||
# Git tags
|
||||
gitlink-cli tag +list --owner Gitlink --repo forgeplus --all
|
||||
|
||||
# Create an issue
|
||||
gitlink-cli issue +create --owner Gitlink --repo forgeplus -t "Bug: Login failed" -b "Steps to reproduce..."
|
||||
|
||||
|
|
|
|||
|
|
@ -336,9 +336,17 @@ gitlink-cli member +invite-link --owner Gitlink --repo forgeplus --role develope
|
|||
gitlink-cli issue +list --owner Gitlink --repo forgeplus
|
||||
|
||||
# 自动翻页拉取全部(适用于所有可分页 list 命令:
|
||||
# issue/pr/branch/release/milestone/org/repo/label/member/webhook +list、search +repos/+users)
|
||||
# issue/pr/branch/release/milestone/org/repo/label/member/webhook/tag/commit +list、
|
||||
# issue +comments、repo +watchers/+stargazers/+forks、search +repos/+users)
|
||||
gitlink-cli issue +list --owner Gitlink --repo forgeplus --all
|
||||
|
||||
# 提交历史与单个提交详情
|
||||
gitlink-cli commit +list --owner Gitlink --repo forgeplus --ref develop --all
|
||||
gitlink-cli commit +view --owner Gitlink --repo forgeplus --sha <sha>
|
||||
|
||||
# Git 标签
|
||||
gitlink-cli tag +list --owner Gitlink --repo forgeplus --all
|
||||
|
||||
# 创建 Issue
|
||||
gitlink-cli issue +create --owner Gitlink --repo forgeplus -t "Bug: 登录失败" -b "复现步骤..."
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@
|
|||
生产实测 forgeplus 16 个 tag 分页与 --all 合并均通过。
|
||||
- 新增 `commit +list` 命令组:分页的 `/v1/:owner/:repo/commits`
|
||||
端点此前只能通过裸 api 命令访问;支持 `--ref` 指定分支/tag/SHA
|
||||
(映射 sha 参数,生产实测 forgeplus 6762 commits、develop 5346)。
|
||||
(映射 sha 参数,生产实测 forgeplus 6762 commits、develop 5346);
|
||||
另新增 `commit +view --sha` 单提交详情(v1 无此端点,走遗留
|
||||
`/api/:owner/:repo/commits/:sha`,生产实测含 diff 统计与文件列表)。
|
||||
- 新增 `repo +forks`:分页的 forks 列表(总数键 `count`,
|
||||
生产实测 forgeplus 77 个 fork 全量合并);此前只有 fork 创建命令。
|
||||
- 修复翻页助手服务端封顶 limit 丢数据 bug:当端点把请求的 limit
|
||||
|
|
|
|||
|
|
@ -48,5 +48,26 @@ func Shortcuts() []*common.Shortcut {
|
|||
return ctx.Output(env)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "view",
|
||||
Description: "View a single commit",
|
||||
Flags: []common.Flag{
|
||||
{Name: "sha", Short: "s", Usage: "Commit SHA", Required: true},
|
||||
},
|
||||
Run: func(ctx *common.RuntimeContext) error {
|
||||
if err := ctx.ResolveOwnerRepo(); err != nil {
|
||||
return err
|
||||
}
|
||||
sha, err := ctx.RequireArg("sha")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
env, err := ctx.CallAPI("GET", fmt.Sprintf("%s/commits/%s", ctx.RepoPath(), sha), nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ctx.Output(env)
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue