Live data from Hacker News

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

github.com

61–70 of 98 posts

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

#61

What's a good way to convert the output of something like this into an html page? We have non technical people looking at markdown PRs and commits in github and the diff viewer is terrible. It will highlight and entire paragraph because someone removed a trailing space. I use git-so-fancy locally which makes it much easier to see changes but I can't expect non-technical editors to move from their GitHub based workflo…

xfce4-terminal supports "Copy as HTML" for stuff like this.

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

#62
post #29
post #4

I use both delta and difftastic (difft), and cannot recommend them enough. If you use the terminal at all, get them!

I've been using difftastic for a while. How do you use both together?

I am also curious.

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

#64

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.

Neat! thanks for sharing. Few times I needed that but I had to go hunting down the full path.

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

#65

What's a good way to convert the output of something like this into an html page? We have non technical people looking at markdown PRs and commits in github and the diff viewer is terrible. It will highlight and entire paragraph because someone removed a trailing space. I use git-so-fancy locally which makes it much easier to see changes but I can't expect non-technical editors to move from their GitHub based workflo…

Try webdiff (I’m the author) https://pypi.org/project/webdiff/

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

#66

What's a good way to convert the output of something like this into an html page? We have non technical people looking at markdown PRs and commits in github and the diff viewer is terrible. It will highlight and entire paragraph because someone removed a trailing space. I use git-so-fancy locally which makes it much easier to see changes but I can't expect non-technical editors to move from their GitHub based workflo…

https://dandavison.github.io/delta/tips-and-tricks/export-to...

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

#67
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!

magit-delta https://github.com/dandavison/magit-delta

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

#68
Why? How does syntax coloring help in this context? I don't use syntax coloring at all in my editor, I don't think it adds any information or clues that help me understand the code. I think colored diff output (beyond red for deleted and green for added) just adds distractions.

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

#69
post #68

Why? How does syntax coloring help in this context? I don't use syntax coloring at all in my editor, I don't think it adds any information or clues that help me understand the code. I think colored diff output (beyond red for deleted and green for added) just adds distractions.

Delta can show in the terminal a diff that looks like the GitHub one. You can compare side by side what was changed. It also highlight with more strength what changed inside the line. I installed it once, and never came back to the standard diff output.

If Delta doesn't work like you expected and you want a standard diff output temporarily, no problem, you can run Git with

git -c core.pager=less

Note also that if you redirect the Git output, Git is smart enough to not call the pager (in this case, Delta)

This is a case of personal taste. My only complaint about Delta is its name. Delta is already a concept in Git, and every time that I need to search about it is a pain... I search directly by "dandavision delta"

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

#70

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.

That's even better, thank you!
Post reply on HN