git: git_show diff headers lack git's a/ and b/ path prefixes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- git
- 领域
- devtools
调研方向
问题出在 git MCP 服务器的 git_show 工具中,它输出的 diff 头部缺少 git 的 a/ 和 b/ 前缀。从 git_show 构建每个文件的 --- 和 +++ 头部行的位置开始,并与修改文件以及新增或删除文件的 git show 输出进行比较。完成的标准是头部与 git show 一致(a/<path>、b/<path>,缺失一侧使用 /dev/null),并且输出可以通过 git apply 应用。
由索引模型根据 Issue 内容生成。
描述
Problem
git_show prints each file's diff with bare paths: --- x.py^0 / +++ /dev/null, --- logic/a.py / +++ logic/a.py. git itself writes --- a/<path> / +++ b/<path>. The issue that rewrote git_show's output (#4998) asked for git's header format and /dev/null, which are met; the prefixes were left out.
Without them the output is not a patch that git apply (or patch -p1) accepts as is: they strip one leading path component, so logic/a.py is read as a.py.
Found while verifying the v1.0.0 release ledger (#5080), on mcp-server-git 2026.10.10; present on v2/main too.
Expected
git_show diff headers match git show: --- a/<path> and +++ b/<path>, with /dev/null (no prefix) for an added or deleted side.
- 主要语言
- JavaScript
- 星标
- 91.2k
- 派生
- 11.8k
- 平均合并
- 6 小时 52 分钟
- 30 天内合并 PR
- 107
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
documentation v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/servers#5133 ·
维护者通常 1 天内回复
-
sequentialthinking: the thought box's header row is 2 columns narrower than its border可能已有人在做 @nightcityblade 于 1 天前认领。 未关闭bug server-sequentialthinking v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5108 · 2 条评论 ·
维护者通常 1 天内回复
-
chore v2
难度 2/5 1-3 小时 新手友好度 80/100
modelcontextprotocol/servers#5091 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/servers#5071 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
modelcontextprotocol/servers#5059 · 2 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
enhancement
难度 1/5 1-3 小时 新手友好度 85/100
holepunchto/hrpc-test#28 ·
-
good first issue
难度 1/5 1-3 小时 新手友好度 88/100
anoopcodehack/DevBoard#616 ·
维护者通常 2 天内回复
-
idnits3
难度 2/5 1-3 小时 新手友好度 63/100
ietf-tools/idnits#319 ·
-
难度 1/5 1 小时以内 新手友好度 76/100
521xueweihan/HelloGitHub#3939 ·