Better Git diff output for Ruby, Python, Elixir, Go
21–30 of 53 posts
Re: Better Git diff output for Ruby, Python, Elixir, Go
#22From 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/
Re: Better Git diff output for Ruby, Python, Elixir, Go
#23I tried to figure out why the extensions aren't configured by default. I found a 2011 patch/proposal to make it the default, which appears to have stranded: https://lore.kernel.org/git/20110825204047.GA9948@sigill.int... With some discussion by the patch's author of possible downsides ( https://lore.kernel.org/git/20110826025913.GC17625@sigill.in... ): > I think it could be a problem in the future if the builtin user…
I don’t see any downside apart from extensionless files like shell scripts with the executable flag set, shebang, and no file extension which could also be solved.
Edit: and if comprehensive correctness was truly desired, file magic could make a better guess, but that would be overkill imo.
Re: Better Git diff output for Ruby, Python, Elixir, Go
#24I 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
#25Am I missing something? Those diffs look identical. Edit: got it. Thanks!
Re: Better Git diff output for Ruby, Python, Elixir, Go
#26Diffs 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…
Re: Better Git diff output for Ruby, Python, Elixir, Go
#27I 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).
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.
Re: Better Git diff output for Ruby, Python, Elixir, Go
#28I 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
#29I tried to figure out why the extensions aren't configured by default. I found a 2011 patch/proposal to make it the default, which appears to have stranded: https://lore.kernel.org/git/20110825204047.GA9948@sigill.int... With some discussion by the patch's author of possible downsides ( https://lore.kernel.org/git/20110826025913.GC17625@sigill.in... ): > I think it could be a problem in the future if the builtin user…
Re: Better Git diff output for Ruby, Python, Elixir, Go
#30From 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…