How to build a `Git diff` driver

(jvt.me)

102 points | by zdw 11 hours ago

6 comments

  • yboris 9 hours ago
    Related: my favorite viewer is diff2html-cli which lets you see the diff in your browser:

    https://diff2html.xyz/

    • danvk 3 hours ago
      You might also like webdiff, which does something similar https://github.com/danvk/webdiff (I built this years ago and still use it every day.)
    • JavierFlores09 9 hours ago
      my favorite online diff viewer so far is https://diffs.dev/, very straightforward. Diff2html looks cool too given it can work in terminal
    • forrestthewoods 6 hours ago
      Why not just use Araxis Merge or Beyond Compare?
      • WalterGR 3 hours ago
        Some alternatives to paid solutions:

        WinMerge is excellent, open source, and while Windows-only, it runs well in Wine without needing any tweaks.

        Kdiff is open source, cross-platform, and while I personally don’t love it, it supports 4-pane merge, which is quite ergonomic and rare.

  • faangguyindia 31 minutes ago
    Nothing beats sublime merge for this.
  • tarun_anand 2 hours ago
    Is there an OSS git diff for images and multimedia?
    • alkh 1 hour ago
      I bet there might be something but you can probably create your own by using ImageMagick[1] and some manipulations. For ex. for images, I would create a temp file or use a process substitition + open on OSX or xdg-open on Linux. Here is a first post about

      Or you can make it even easier(cause the output is only a text) and simply print out the difference in metadata directly. You might need some other tools like ImageMagick but at least no shenanigans with viewing binary data as part of your diff.

      [1]https://stackoverflow.com/questions/5132749/diff-an-image-us...

    • da_rob 1 hour ago
      Yes, there is imgap: https://github.com/roblillack/imgap

      You can use it to create delta images for git diff but also to interactively compare changes via git difftool.

  • gritzko 9 hours ago
    I recently implemented a diff driver as part of git-dogs. The integration part Claude one-shotted.

    Mine is token based: https://replicated.wiki/blog/img/difflet.png

    The set of git tools itself, very much in development: https://github.com/gritzko/git-dogs

  • semanticintent 4 hours ago
    [flagged]