Open
[转交] git-repo tree 不支持 --path 且 --depth recursive 在 gitcode 直接 400 #357
马岩松Add on 2 days ago
grape_bot
2 days ago Comments:
2 days ago Comments:
[VOD Agent] 已复核本条,结论:诉求已被仓库内既有 Issue 覆盖,建议本条按重复件处理(原始 Issue 描述不改写)。
复现结果(grape 0.3.4 / 契约 v2.3.0a1 / 本仓 grape-dev/grape-cli / ref=ldw)
grape git-repo tree --path src→Error: No such option '--path'. Did you mean '--depth'?(--path能力缺口,与描述一致)grape git-repo tree --depth recursive→HTTP 400: 该平台(gitcode)暂不支持递归树:recursive 返回破碎树(丢失 blob),请用单层或 Git 仓库等效接口(调用后才失败,与描述一致)grape git-repo tree --help当前已含 “depth=recursive is GitHub-only (GitCode rejects it)”,说明「帮助文档标注平台差异」部分已由 #234 交付;仍缺的参数校验期前置报错归 #309--depth single正常返回,逐层contents --path仍是当前唯一可用路径
覆盖关系
| 本条诉求 | 既有 Issue | 现状 |
|---|---|---|
tree --path 子目录过滤 |
#11(含 grape_cli/registry.py 实现方案与完整验收标准) |
已出 Spec,待实现 |
| 同上(路径前缀列子树 / contents 目录直接返条目,二选一) | #315 | 已收敛,与 #11 同一能力 |
--depth recursive 在 GitCode 前置拒绝 / 自动降级 |
#309(bug / cli-contract / P2 / spec-ready,已出 Spec) | 已 triage,待实现 |
recursive 文案误导(pulls files 仍宣传 recursive 为回退方案) |
#234 | 已关闭 |
--depth 非法值静默按单层处理 |
#50 | 处理中 |
建议
- 本条可作为重复件关闭:
--path诉求计入 #11,recursive400 前置校验诉求计入 #309,无需在第三条 Issue 上重复排期。 - #315 与 #11 指向同一能力(一次性列出子树),建议二者择一保留为主跟踪项,避免同一实现被并行领取。
- #11 / #309 合入后,本条四个验收项可逐项对照勾选归档。
本次未发起交办:能力实现已在 #11 / #309 的评审与实现队列中,重复交办会造成同一改动多次排期。


目标
grape git-repo tree支持子目录过滤(--path),并在 GitCode 平台对--depth recursive的限制前置到参数校验/帮助文档,避免调用后才返回 400。现状
grape git-repo tree --ref <branch> --path src/api报--path不存在;tree 仅支持--ref/--depth等参数。--help仅在说明里标注depth=recursive为 GitHub-only,未对 GitCode 前置提示。--depth recursive在 GitCode 直接返回 HTTP 400「该平台(gitcode)暂不支持递归树」,错误只有在实际调用后才暴露。contents --path <dir>多次往返,目录级浏览成本高。期望行为
tree增加--path子路径过滤(服务端映射git/trees+ path 前缀截取)。--help明确「GitCode 不支持 recursive」,并在参数校验期即返回可读错误(而非调用后 HTTP 400);同时给出contents逐层列目录的推荐用法示例。验收标准
优先级
P2(一般)
来源:grape-dev/grape#3987(由 VOD Agent 归仓判断转交)
auto-submitted by VOD Agent