7 ms·
Icdiff: Side-by-side highlighted command line diffs
- warkdarrior 6y agocolordiff -y [https://www.colordiff.org/ https://www.colordiff.org/] has similar functionality.
- Lio 6y agoAnother alternative: Kitty-diff It’s terminal specific as it uses kitty’s graphics extensions but it looks really IMHO. https://sw.kovidgoyal.net/kitty/kittens/diff.html https://sw.kovidgoyal.net/kitty/kittens/diff.html
- jefftk 6y agocolordiff highlights the entire line when any part is changed: * colordiff -y: https://www.jefftk.com/colordiff-y-example-simple.png https://www.jefftk.com/colordiff-y-example-simple.png * icdiff: https://www.jefftk.com/icdiff-example-simple.png https://www.jefftk.com/icdiff-example-simple.png icdiff also makes better use of horizontal space.
- auraham 6y agoThis is a really useful utility. This post explains how to use it with mercurial for better diffs: https://ianobermiller.com/blog/2016/07/14/side-by-side-diffs-for-mercurial-hg-icdiff-revisited/ https://ianobermiller.com/blog/2016/07/14/side-by-side-diffs...
- splittingTimes 6y agoIn your experience, What's the best tool to check 3-way merge diffs under windows?
- TheDong 6y agoBoth emacs and vim can be run under windows, and both have the ability to display 3-way merges quite well. For emacs, you'd want magit + smerge or ediff. In vim, you'd want vimdiff + vim-fugitive for a few handy helpers.
- virgilp 6y agoNot free, but Araxis Merge is pretty good.
- acqq 6y ago> 3-way merge diffs under windows Is there any reason for not using kdiff3?
- pantalaimon 6y agoMeld is pretty neat
- throwaway744678 6y agoYet another option: p4merge (from Perforce) works great.
- wayneftw 6y agoBeyond Compare
- donatj 6y agoIt really does live up to it's name in my opinion. Been using it for over a decade, originally in Windows but now macOS
- SAI_Peregrinus 6y agoI use CLion (or other Jetbrains IDEs, eg PyCharms on the occasions I'm not working in C/C++/Rust). They've got a very nice built-in 3-way merge diff tool. Non-free for some of the IDEs, but if you're working with a language that has a free "community edition" this is viable. Or if you're willing to pay for a very nice IDE.
- corytheboyd 6y agoI’ll get shot down for it, but I love the JetBrains IDE visual merge tool. It’s not free, but this among other things makes it worth it for professional work.
- jez 6y agoAnother little known diff power tool: vim -d old.txt new.txt This will open two files in diff mode. You can then use a whole host of fancy keybindings to edit the two files in a diff-aware way ("apply this hunk to that file" / manually edit a file and then re-render the diff / "fold or expand all non-hunk text" / etc.). For more: :help diff or see here https://neovim.io/doc/user/diff.html https://neovim.io/doc/user/diff.html
- heeen2 6y agoI am a big fan of the patchreview plugin, I use it every day. It opens a multifile diff (e.g. git diff patch output) each file in a vim tab. https://github.com/junkblocker/patchreview-vim https://github.com/junkblocker/patchreview-vim $ gvim -c"DiffReview git diff origin/master"
- hnlmorg 6y agoGood shout. I've used that a fair few times when working through some more complex diffs. It's also often symlinked as `vimdiff`
- bno1 6y agoA similar tool that I really like is meld (https://meldmerge.org/ https://meldmerge.org/). It has a GUI, really nice visual indicators, allows you to view the entire file and directory trees and you can jump between diff chunks using alt + arrow up/down. I often use it with git: git difftool -t meld -d
- wffurr 6y agoHow is that similar? It's a GUI. There's a zillion GUI diff tools but very few console ones. icdiff is the only side by side CLI diff tools I have seen.
- js2 6y agosdiff has been around forever: https://linux.die.net/man/1/sdiff https://linux.die.net/man/1/sdiff It’s not a three-way diff and not highlighted however. (icdiff doesn’t seem to be a three-way diff either.)
- tutfbhuf 6y agoI wish Icdiff had syntax highlighting for common programming languages.
- wffurr 6y agoWouldn't the syntax coloring interfere with the diff coloring? Is there an example of a tool that does both?
- rgoulter 6y agoAt least one of the other tools in this thread does both. (Rather than visualising add/rm with the foreground, it's visualised with the background colour). https://github.com/dandavison/delta https://github.com/dandavison/delta
- tutfbhuf 6y agoYes, but delta doesn't have side-by-side diff. Is someone aware of a command line util, that has side-by-side diff and syntax highlighting? I know that Gitlab can do that.
- jefftk 6y agoLooks like delta has an open issue: https://github.com/dandavison/delta/issues/86 https://github.com/dandavison/delta/issues/86
- Liquid_Fire 6y agovimdiff does that.
- tutfbhuf 6y agoTrue, but vimdiff is a wrapper around vim, that starts the editor with pre-arranged windows. I would like to have a non-interactive stand-alone tool, that prints the syntax highlighted side-by-side to the terminal then exits and does not require you to learn vim. Maybe such a thing does not exist yet and I have to wait for delta issue #86 to happen.
- e12e 6y agoThis looks nice, but is it very different from gnu(?) diff --color=always --side-by-side?
- jefftk 6y agoCould you share a screenshot? When I run GNU diff with --side-by-side, it seems that --color=always is ignored: https://www.jefftk.com/gnudiff-color-always-side-by-side.png https://www.jefftk.com/gnudiff-color-always-side-by-side.png
- e12e 6y agohttps://postimg.cc/4Y2Jh6pz https://postimg.cc/4Y2Jh6pz
- jefftk 6y agoThanks! After playing with diff --color=always --side-by-side more, it looks like it colors inserted and deleted lines but not changed lines: https://www.jefftk.com/icdiff-vs-diff-color-always-side-by-side.png https://www.jefftk.com/icdiff-vs-diff-color-always-side-by-s... (And it still doesn't find changes within a line)
- e12e 6y agoI think, for changes within a line, wdiff would be the usual tool - but even if it's possible to pipe that through colordiff - I don't think there's a side-by-side mode for wdiff. But yeah, I see that in-line highlighting of changes can be helpful sometimes :)
- fphilipe 6y agoIf you're used to Git's diff view and want to use it for any two files outside of a repo, you can do $ git diff --no-index file_a file_b
- NateEag 6y agoDelta is a similar tool with syntax highlighting for most programming languages and customizable themes: https://github.com/dandavison/delta https://github.com/dandavison/delta It doesn't have side-by-side diffs, but it's still well worth having around. It's a Unix filter, so it works on any unified diff you can come up with. Its default output isn't a unified diff, but that's easy to fix with its configuration / CLI options (I'm too used to reading unified diffs to like delta's simplified default format).
- mixmastamyk 6y agoI've been using `alias diff=colordiff` for maybe twenty years. Looks like icdiff can highlight small changes without needing to call out the whole line. Is there anything else new this one brings?
- jefftk 6y agoScreenshots: * colordiff -y: https://www.jefftk.com/colordiff-y-example-simple.png https://www.jefftk.com/colordiff-y-example-simple.png * icdiff: https://www.jefftk.com/icdiff-example-simple.png https://www.jefftk.com/icdiff-example-simple.png The two main differences I see are that icdiff can highlight the affected portions of lines, and that icdiff makes better use of horizontal space.
- mixmastamyk 6y agoI see. Also, I'd configured colordiff to use green and red as well.
- pabs3 6y agoI like diffoscope's side-by-side HTML diffs of arbitrary files/dirs, for eg: https://diffoscope.org/ https://diffoscope.org/ https://diffoscope.org/examples/https-everywhere-5.0.6_vs_5.0.7.html https://diffoscope.org/examples/https-everywhere-5.0.6_vs_5....
- yboris 6y agoRelated: diff2html CLI that will open your browser to a beautifully-rendered HTML diff: https://diff2html.xyz/ https://diff2html.xyz/
- zestyping 6y agoydiff might be the tool you're looking for. https://github.com/ymattw/ydiff https://github.com/ymattw/ydiff
- ncr100 6y agoYdiff is GIT aware. It made me :) recently when I needed to diff a 6 month branch divergence.