-
Notifications
You must be signed in to change notification settings - Fork 627
Open
Labels
bugSomething isn't workingSomething isn't workingeffort-smallQuelques heures, 1 fichierQuelques heures, 1 fichierfilter-qualityFilter produces incorrect/truncated signalFilter produces incorrect/truncated signalgood first issueGood for newcomersGood for newcomers
Description
Description
rtk diff incorrectly reports files as identical when modified lines share a long common prefix. The underlying /usr/bin/diff correctly detects the differences.
Version
Built from source at commit 97b6878
Minimal reproduction
# FAILS — reports identical (4+ char common prefix)
printf "abcd\n" > /tmp/a.txt
printf "abce\n" > /tmp/b.txt
rtk diff /tmp/a.txt /tmp/b.txt
# → [ok] Files are identical
# WORKS — correctly detects difference (3 char prefix)
printf "abc\n" > /tmp/a.txt
printf "abd\n" > /tmp/b.txt
rtk diff /tmp/a.txt /tmp/b.txt
# → +1 added, -1 removed
# Verification with system diff
/usr/bin/diff /tmp/a.txt /tmp/b.txt
# → 1c1 < abcd --- > abceAdditional examples
# Also fails with multi-word lines
printf "foo bar\n" > /tmp/a.txt
printf "foo baz\n" > /tmp/b.txt
rtk diff /tmp/a.txt /tmp/b.txt
# → [ok] Files are identical
# Also fails with longer content
printf "abc def\n" > /tmp/a.txt
printf "abc deg\n" > /tmp/b.txt
rtk diff /tmp/a.txt /tmp/b.txt
# → [ok] Files are identicalExpected behavior
rtk diff should report the differences, consistent with /usr/bin/diff.
Suspected cause
A similarity threshold in rtk's diff filtering appears to treat lines that are "close enough" as identical, when it should only filter output formatting — not discard actual differences.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingeffort-smallQuelques heures, 1 fichierQuelques heures, 1 fichierfilter-qualityFilter produces incorrect/truncated signalFilter produces incorrect/truncated signalgood first issueGood for newcomersGood for newcomers