News for hackers. Stuff that matters.
Re:DiffX – Next-Generation Extensible Diff Format by itake on Tuesday June 03, 2025 @11:59PM (#44177098)
One of my issues that remains unsolved with diff tools is they are dependent on new line attributes.

Reviewing changes on a long line (like compressed json or long array) is too difficult.

Re:DiffX – Next-Generation Extensible Diff Format by devman0 on Wednesday June 04, 2025 @01:37AM (#44177538)
git does have word diffing if you need something more granular than line diffing, the default delimiter being whitespace.
Re:DiffX – Next-Generation Extensible Diff Format by itake on Wednesday June 04, 2025 @02:57AM (#44177883)
oo I didnt' realize that. that seems pretty close to what I want, but the git tools (cli or Github Desktop) still print the entire line.

For line diffing, it clips to only show the ~3 line before and after the change. But the word diff still prints the entire line and you have to scroll to find the change in the line wrapping.

Re:DiffX – Next-Generation Extensible Diff Format by eddd-ddde on Wednesday June 04, 2025 @09:23AM (#44180479)
You can use `delta` as a diff pager and it includes word-diff-syntax-highlight.
Re:DiffX – Next-Generation Extensible Diff Format by saghm on Wednesday June 04, 2025 @01:53AM (#44177612)
I think part of the problem is that the common format used is somewhat of a compromise between being human readable and parseable by tools. I can sort of see where the author of this tool is coming from with trying to address some of that with metadata, but I feel like the better way might be to come to with a format that isn't reliant on plaintext but instead can be rendered to something more readable. Coming up with a way to calculate reasonable diffs on files like you mention that doesn't generate worse diffs than we have now for existing stuff would be challenging, but it doesn't feel like it would be impossible to solve.
Re:DiffX – Next-Generation Extensible Diff Format by chipx86 on Wednesday June 04, 2025 @02:40AM (#44177803)
Absolutely agree. I think there's a lot of avenues to explore for better diff representations for structured data (which would also be great for ASTs, something we've been thinking about).

This format is meant to be an extension of Unified Diffs (much like the diff formats of most SCMs), and not something entirely new and focusing on other areas. But if more specific diff formats become widespread, we could directly support encoding them within DiffX as well, as we do for binary diffs formats.