Live data from Hacker News

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

github.com

51–60 of 98 posts

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

#51
Speaking of diffs, one thing that annoys me about Git's diff output is that is prints file paths like Unix diff traditionally does, starting with the two file names:

    --- a/some/path/to/file.c
    +++ b/some/path/to/file.c
I often cmd-click in iTerm to open a file in an editor, but this doesn't work here because of the a/ and b/ prefixes. Any way to make Git format the file name better? I don't even need two lines here.

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

#52
post #7
post #5

i knew git could use arbitrary diff filter but never realised it was this simple to use. This looks very nice. The related? project "bat" also looks interesting.

If you are getting to check out bat, you might want to check, - rg (ripgrep): A grep replacement - sk (skim): A grep/fzf/fzy replacement - fd: A find replacement that's .gitignore+.ignore aware. - eza: A replacement for ls that's git aware - broot: A TUI file finder to browse large directories - yazi: A file manager (I haven't used this one too much) sk+rg + gawk in action to find files matching some text, sk \ --ans…

> eza: A replacement for ls that's git aware

I've been using eza (and exa before it) for a long time, but only for the pretty and colored output. I didn't even know about the git support! I now added the --git flag to my alias and will try it out. Thank you!

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

#53

Speaking of diffs, one thing that annoys me about Git's diff output is that is prints file paths like Unix diff traditionally does, starting with the two file names: --- a/some/path/to/file.c +++ b/some/path/to/file.c I often cmd-click in iTerm to open a file in an editor, but this doesn't work here because of the a/ and b/ prefixes. Any way to make Git format the file name better? I don't even need two lines here.

[deleted]

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

#54

Speaking of diffs, one thing that annoys me about Git's diff output is that is prints file paths like Unix diff traditionally does, starting with the two file names: --- a/some/path/to/file.c +++ b/some/path/to/file.c I often cmd-click in iTerm to open a file in an editor, but this doesn't work here because of the a/ and b/ prefixes. Any way to make Git format the file name better? I don't even need two lines here.

  git config --global diff.noprefix true
Checkout the manual for more prefix options.

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

#56

Not as fancy, but if you want halfway reasonable word-level diffs with just standard issue git, this is often good enough: git diff --color-words --word-diff-regex='\w+|.'

How do I enable this by default (in .gitconfig)?

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

#57

Speaking of diffs, one thing that annoys me about Git's diff output is that is prints file paths like Unix diff traditionally does, starting with the two file names: --- a/some/path/to/file.c +++ b/some/path/to/file.c I often cmd-click in iTerm to open a file in an editor, but this doesn't work here because of the a/ and b/ prefixes. Any way to make Git format the file name better? I don't even need two lines here.

[dead]

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

#58

Not as fancy, but if you want halfway reasonable word-level diffs with just standard issue git, this is often good enough: git diff --color-words --word-diff-regex='\w+|.'

How do I enable this by default (in .gitconfig)?

Try this

git config --global diff.colorWords true

git config --global diff.wordRegex '\w+|.'

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

#60
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 workflow to a terminal based one

Post reply on HN