diff -e: extra empty "a" command after a "." line at the end of a hunk
维护者通常 1 天内回复
评估
调研方向
首先找到生成 diff -e 脚本的代码及其测试;issue 未指定具体文件。将 hunk 以仅包含 . 的行结尾时生成的脚本与 GNU diff 3.10 进行比较。输出省略末尾空的 a 命令并与示例一致,即为完成。
由索引模型根据 Issue 内容生成。
描述
A line that is just "." can't go straight into an ed script, so it's written as "..", the text is ended and s/.// fixes it up. We always start a new a after that, even when the "." was the last line of the hunk, so the script ends with an empty a and .. GNU diff only adds the a when more lines follow.
$ printf 'a\nb\n' > old
$ printf 'a\nb\n.\n' > new
$ diff -e old new # GNU diff 3.10
2a
..
.
s/.//
$ diffutils diff -e old new
2a
..
.
s/.//
a
.
ed still gives the right result, but the output isn't the same as GNU.
- 主要语言
- Rust
- 星标
- 280
- 派生
- 49
- 平均合并
- 4 天 12 小时
- 30 天内合并 PR
- 24
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uutils/diffutils 的其他 Issue
-
diff: -U/-C given with -u/-c uses the wrong context length可能已有人在做 @qodelicious 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
cmp: quiet mode compares full file sizes before applying -n可能已有人在做 @SichenLiang 于 35 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)可能已有人在做 @sami-daniel 于 86 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflow可能已有人在做 @MsfPablo 于 81 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
uutils/diffutils#245 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
coollabsio/orbit#72 ·
维护者通常 1 天内回复
-
Synth suite fails unless run from the repo root: signal_flow's default machine path is cwd-relative未关闭bug
难度 2/5 1-3 小时 新手友好度 80/100
Nimblesite/osprey#370 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
bug order-flow studies ui
难度 2/5 1-3 小时 新手友好度 88/100
userFRM/egui-charts#2417 ·
维护者通常 1 天内回复