feat(compare): 增加 compare 汇总与提交筛选命令 #311
Loading…
Reference in New Issue
No description provided.
Delete Branch "Mengz/gitlink-cli:mengz/compare-summary-pr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
变更说明
这次补齐了
compare维度里两个高频但此前缺失的能力:compare +commits:按分支差异列出提交,支持限制数量与结构化输出,便于快速查看一个功能分支到底带来了哪些提交。compare +summary:直接汇总两个分支之间的提交数、文件数、增删统计、重点文件、路径分组和扩展名分布,适合在评审前先判断改动规模与影响面。很多场景并不需要一上来就看完整 diff,而是先判断这个分支改了多少文件、主要集中在哪些目录、是否只是文档改动、是否值得安排完整评审。此前 CLI 只能拿到原始 compare 结果,维护者和脚本往往还要再做一层统计。现在把这层常用汇总逻辑直接沉到命令里,既方便人工浏览,也方便自动化消费。
包含内容
compare +commitscompare +summary本地验证
已通过:
go test ./shortcuts/compare/...go build ./...go test ./...git diff --check另外做了接口冒烟验证:
go run . --format json compare +summary --owner Gitlink --repo gitlink-cli --head Mengz:mengz/compare-summary-pr --base master返回的
commits_count、files_count、change_totals、top_files、path_groups、extensions均符合预期。