Live data from Hacker News

Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

github.com

81–90 of 98 posts

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#82
post #32

Earlier quoted context omitted.

Sure, but I use Araxis Merge as my basic diff tool as well.

If you use a GUI to view the output of git diff... then yea this probably isn't for you :P

You say that like it’s a bad thing?

Default git diff output is soooooooooo bad. This tool makes it closer to a good GUI tool. At which point why not just use one of the tools that is excellent and existed for decades?

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#83
post #45

I’ve been using Araxis Merge for almost 20 years. This seems… not as good?

Does Araxis Merge work in the terminal on Linux?

Running inside a terminal provides precisely zero value to me.

Perhaps the answer is “git-delta attempts to provide a GUI like experience. If you can use a GUI you should. But if for some reason you can’t consider this as a less good alternative”.

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#84
post #78

There was a good point made, that has stuck with me over the years. that our syntax highlighters are highlighting the wrong thing. They should not be coloring the grammar, we are good at picking out grammar, they should be highlighting the symbols. each different variable and function name should be getting it's own color. that is, the goal is to make it quicker to distinguish different symbols, not that they are a s…

Totally agree, at first it looked alien to me but I've grown used to and prefer this way of highlighting. Personally I use color-identifiers-mode[0] for Emacs.

[0] https://github.com/ankurdave/color-identifiers-mode

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#85
post #78

There was a good point made, that has stuck with me over the years. that our syntax highlighters are highlighting the wrong thing. They should not be coloring the grammar, we are good at picking out grammar, they should be highlighting the symbols. each different variable and function name should be getting it's own color. that is, the goal is to make it quicker to distinguish different symbols, not that they are a s…

This is what KDevelop called Semantic Highghting (as opposed to Syntax Highlighting). I think it was there earlier than this, but the earliest post I can find describing it is from 2009: https://zwabel.wordpress.com/2009/01/08/c-ide-evolution-from...

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#86
post #32

Earlier quoted context omitted.

If you use a GUI to view the output of git diff... then yea this probably isn't for you :P

You say that like it’s a bad thing? Default git diff output is soooooooooo bad. This tool makes it closer to a good GUI tool. At which point why not just use one of the tools that is excellent and existed for decades?

Because some people, prefer to use their terminal as their universal IDE.

Most of the time, diffs are small, and the overhead/break in workflow, of starting a separate GUI program just for them, can be big.

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#88

Delta has been one of those set and forget things, it's been a while since I've seen 'bare' git grep/diff/blame output, I also use it all the time for normal diffs (outside of git repos), but TIL that it also works with ripgrep [0] As someone else already mentioned there is also bat[1], which was also set and forget, I aliased cat to bat and have a seperate alias vcat for 'vanilla cat' /usr/bin/cat [0] https://dandav…

You can use \cat to prevent alias expansion.

Or 'command cat', which is a little less convenient but will also handle the case where "cat" is a function, not an alias.

(In bash at least. Not sure about newfangled shells!)

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#89
Here's a handy delta trick for you, to turn the side-by-side feature on and off based on window size. bash here, other shells left as an exercise:

  function delta_sidebyside {
    if [[ COLUMNS -ge 120 ]]; then
      DELTA_FEATURES='side-by-side'
    else
      DELTA_FEATURES=''
    fi
  }
  trap delta_sidebyside WINCH

Re: Delta: A syntax-highlighting pager for Git, diff, grep, and blame output

#90
post #6

Earlier quoted context omitted.

Difftastic and Delta work not only in bare terminals. Both are supported by Magit in Emacs, both are also supported by Lazygit.

What??? Do I have to set something in Magit for that to work? That would be one of the coolest news in weeks!

For delta, there's magit-delta in MELPA.

For difftastic, there is difftastic package in MELPA, see also https://github.com/pkryger/difftastic.el for instructions.

Post reply on HN