Is there a good utility for diff-ing JSON content? I am calling jq to sort keys first and then let the default textual diff highlight the changes, but that's neither convenient nor complete.
Better Git diff output for Ruby, Python, Elixir, Go
31–40 of 53 posts
Re: Better Git diff output for Ruby, Python, Elixir, Go
#32From the title I was hoping that it was going to do syntax-aware alignment of diffs, but alas no. I've been using kdiff3 even though it hasn't been updated in a very long time because it has one killer feature: manual diff alignment. I can select a token in both (or all three) files and then force the diff to align at that point. It makes merges a whole lot easier. Sometimes, a single realign is all that's needed for…
Re: Better Git diff output for Ruby, Python, Elixir, Go
#33I use delta as a diff tool: https://github.com/dandavison/delta It also offers contextual information as well as side-by-side diffs. For syntax highlighting, it uses the same as bat (the cat clone).
Insane that I never tried looking for different diff tools, thanks for the recommendation!
Re: Better Git diff output for Ruby, Python, Elixir, Go
#34Earlier quoted context omitted.
This looks like a great command line alternative to git diff or diff, but I have to admit that I greatly prefer meld when I need a quick diff against non version controlled files, or sublime merge when using revision controlled files.
still using Sublime Merge? I never used it, wondering if you still like it
It's properly fast, the diff/stage/commit/etc UX is excellent. I particularly enjoy how straightforward it makes it to hand-pick lines from multiple files really quickly. The interface abstracts over enough of the Git ux/api to make it get out of your way, but in a way that doesn't make what it's doing a mystery or too out of your control - hovering over a button will often yield the equivalent git cli commands for example.
Personal preference here, but it's also not an electron app, so it's very resource light.
Re: Better Git diff output for Ruby, Python, Elixir, Go
#35Earlier quoted context omitted.
> Did I miss something? Sure https://download.kde.org/stable/kdiff3/
Aww, you got my hopes up but that looks like KDE-only fork of the original, which lives here: http://kdiff3.sourceforge.net/
In theory there's newer builds of kdiff3 but I've not had any luck running the Windows versions & I don't think there's been significant improvements to the manual alignment code which still require a lot of battling to get the right outcome.
Re: Better Git diff output for Ruby, Python, Elixir, Go
#36 git config --global core.attributesfile ~/.gitattributes
Git looks for your personal attributes file by default in ~/.config/git/attributes (well, $XDG_CONFIG_HOME/git/attributes to be precise), so if you put it there you don't have to set the config option.Re: Better Git diff output for Ruby, Python, Elixir, Go
#37I use delta as a diff tool: https://github.com/dandavison/delta It also offers contextual information as well as side-by-side diffs. For syntax highlighting, it uses the same as bat (the cat clone).
Re: Better Git diff output for Ruby, Python, Elixir, Go
#38Diffs are still pretty bad at preserving context, especially the “greedy” diff algorithm that assumes that files are identical for as long as possible instead of preserving as much context around the change as possible (if the diff is equally large. This has the familiar effect where you add a method under an existing method and they both have the same documentation header prefix line such as / , then the diff will m…
Though, being able to refactor code, and assert that it is logically and functionally equivalent as the previous checkin would be super useful, even if there’s some gaps (sting value or comparison changes could not be asserted, for example)
Re: Better Git diff output for Ruby, Python, Elixir, Go
#39I’m curious if others see some value in it, either before or with changes from this post?
Re: Better Git diff output for Ruby, Python, Elixir, Go
#40From the title I was hoping that it was going to do syntax-aware alignment of diffs, but alas no. I've been using kdiff3 even though it hasn't been updated in a very long time because it has one killer feature: manual diff alignment. I can select a token in both (or all three) files and then force the diff to align at that point. It makes merges a whole lot easier. Sometimes, a single realign is all that's needed for…
> Did I miss something? Sure https://download.kde.org/stable/kdiff3/