1. 60

  2. 8

    delta is amazing, I’ve been using for more than a year now. I’ve always wanted to write this tool myself, using python and pygments, then I discovered that tool in rust, and never looked back.

    Here is my $.02 though: In the tool I wanted to write myself, I was planning to look up the git-blob of the two file being diffed, highlight them separately, and re-merge it with the diff given by git.

    This had one major advantage, if the diff in is in a middle of a huge bash heredoc – for example – it would get highlighted properly a string.

    But this tool traded “correct syntax highlighting at al time” for speed and simplicity. Which, at the end, is better than my idea, IMHO. In real life, I’ve only rarely encountered edge-cases that would have been only handled by my algorithm.

    1. 2

      Last time that I tried delta it was on the Linux kernel git history benchmarking https://github.com/c-blake/hldiff and delta bombed out/crashed almost immediately. { It appears now I may have been using a fork (https://github.com/da-x/delta). }

      1. 1

        Do any common editors not have this functionality?

        1. 19

          ed, the standard editor, does not include this functionality.

          1. 9

            Many don’t. And frankly speaking, while you’re reaching for the mouse to open a bunch of menus sequentially then scroll, I am already looking at the relevant diff bit without even moving my eyes from the relevant area on my screen, let alone my hands from the keyboard.

            Point and click UIs can be great for discoverability, but they fall short when it comes to maximize productivity.

            1. 3

              You’re putting words in the parent poster’s mouth, which comes across either as condescending, or at best assumes bad faith, and is hard to address. They don’t mention a workflow with menus or using the mouse, so why did you argument against that?

              And, you say “fall short when it comes to productivity” as if it is a fact when of course it’s not (or cough up som empirical research, thank you).

              Finally, I personally haven’t used any tools without diffing builtin and the most common ones I use daily, emacs’ magit and IDEA (the conflict resolution part, using ‘structural’ (? editable, at least) diffing) are both very usable/fast/your arguments here, without needing to use the mouse.

            2. 7

              I don’t see your point? What’s wrong with having it as a dedicated tool?

              1. 2

                I’m surprised anyone wants or needs this as a stand-alone tool

                1. 20

                  I don’t even know how to respond to this.

                  1. 16

                    I think it’s just lack of imagination. For example, I told git to use it. Works nicely.

                    1. 4

                      I do the same :)

                    2. 4

                      diff is essential part of my workflow. I use it as a way to double check that I agree with everything before a git commit.

                      1. 4

                        I believe that GP meant something along the line “this diff tool is built-in editors like PyCharm or Visual Studio Code, why use this standalone tool?”

                        I don’t know whether I’m becoming 27 y.o. old man, but the new cool kids on the block don’t use Vim and/or Emacs any more. In my professional experience, most think that vim is just a tool to edit files on a Linux server. These old editors (“old”, kakoune is 5 years old) are now considered a relic from the past.

                        1. 5

                          I know what you’re trying to say, but Emacs and Vim have both had built in diffing tools for decades. It’s not a feature modern IDEs invented.

                2. 1

                  Sublime merge inherits sublime text syntax highlighting?

                  1. 1

                    nice! looks like the properly done implementation of my self made diff colorizer i’ve been using for years to easily see differences within lines, https://github.com/neeels/rastapatch (i dont care about syntax highlighting in diffs though)