diff -e: no script at all when a file has no newline at the end
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Read src/ed_diff.rs around lines 65 and 71, where DiffError::MissingNL causes an early return, and inspect the missing_newline test in tests/by-util/test_diff.rs around line 122. Compare diff -e output for files with missing final newlines against GNU diff; done means the ed script is printed and missing-newline warnings match the described behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
When either file's last line has no newline, diff -e prints nothing on stdout:
$ printf 'a\nb' > x; printf 'a\nc\n' > y
$ diffutils diff -e x y
No newline at end of file
$ echo $?
2
$ /usr/bin/diff -e x y # GNU diff 3.12
2c
c
.
/usr/bin/diff: x: No newline at end of file
$ echo $?
2
GNU still writes the ed script, then warns on stderr for each file that lacks the final newline (diff: FILE: No newline at end of file, then a blank line) and exits 2. Both exit 2, but a caller that applies the script, or shows it, gets nothing from uutils.
The early return is in src/ed_diff.rs:65 and src/ed_diff.rs:71 (DiffError::MissingNL). The test missing_newline (tests/by-util/test_diff.rs:122) checks for the current stderr (starts_with("No newline at end of file")), so matching GNU means changing that test. I have a change that matches GNU for either file, both, two different files with the same content, an empty file and stdin (apart from 2,2d, which is #308); happy to open a PR if you want GNU's output here.
uutils diffutils main 8ff5bda and v0.6.0.
- Vorherrschende Sprache
- Rust
- Sterne
- 280
- Forks
- 49
- Ø Merge
- 2 T. 9 Std.
- Gemergte PRs (30 T.)
- 16
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus uutils/diffutils
-
cmp: quiet mode compares full file sizes before applying -nEvtl. vergeben @SichenLiang hat das vor 30 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
diff: `-y --tabsize=<huge>` overflows the column arithmetic (overflow-checks only)Evtl. vergeben @sami-daniel hat das vor 81 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
diff panics on an oversized inline context count (`-c`/`-u`/`-C`/`-U`): parse overflow and capacity overflowEvtl. vergeben @MsfPablo hat das vor 77 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
uutils/diffutils#245 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
sdiff: fix the layout of unchanged rows, blank lines and cut tabsEvtl. vergeben @sami-daniel hat das vor 27 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 28/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in uutils/diffutils
Ähnliche Issues
-
area:docs documentation good first issue priority:medium
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
rtk-ai/rtk#4958 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
calagopus/panel#285 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: streamed Responses API flex_unavailable error maps to 500 InternalServerError instead of 429Offenllm translation
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
BerriAI/litellm#49736 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
question
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
autoindex tests: denied loopback bind shows only PermissionDenied (255 failures), not the causeOffenfield-report
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag