logoalt Hacker News

Show HN: Deff – Side-by-side Git diff review in your terminal

81 pointsby flamestroyesterday at 5:54 PM50 commentsview on HN

deff is an interactive Rust TUI for reviewing git diffs side-by-side with syntax highlighting and added/deleted line tinting. It supports keyboard/mouse navigation, vim-style motions, in-diff search (/, n, N), per-file reviewed toggles, and both upstream-based and explicit --base/--head comparisons. It can also include uncommitted + untracked files (--include-uncommitted) so you can review your working tree before committing.

Would love to get some feedback


Comments

llbbddyesterday at 7:27 PM

I was looking for a good TUI tool for diffs recently, but I'm not sure yet if what I want exists already (and I don't think this tool does it (yet?)). I've been moving my workflow out of VSCode as I'm using TUI-driven coding agents more often lately but one thing I miss from my VSCode/GitHub workflow is the ability to provide a comment on lines or ranges in a diff to provide targeted feedback to the agent. Most diff tools seem to be (rightfully) focused on cleanly visualizing changes and not necessarily iterating on the change.

I admit I haven't looked super hard yet, I settled on configuring git to use delta [0] for now and I'm happy with it, but I'm curious if anyone has a workflow for reviewing/iterating on diffs in the terminal that they'd be willing to share. Also open to being told that I'm lightyears behind and that there's a better mental model for this.

[0] https://github.com/dandavison/delta/

show 7 replies
k_bxyesterday at 7:44 PM

What I would love to see is "tig" replacement that is:

- even faster, especially if you have couple thousand files and just want to press "u" for some time and see them very quickly all get staged

- has this split-view diff opened for a file

Otherwise tig is one of my favorite tools to quickly commit stuff without too many key presses but with review abilities, i have its "tig status" aliased to "t"

meainyesterday at 6:53 PM

I have been using https://github.com/jeffkaufman/icdiff for the longest time to get side by side diffs.

show 2 replies
rileymichaelyesterday at 7:03 PM

getting users to adopt a new tool with its own incantations is a tough sell. git supports specifying an external pager so folks can plug in alternatives (such as https://github.com/dandavison/delta) while still using the familiar git frontend

show 1 reply
suralindyesterday at 11:02 PM

What you want is difftastic. No need to thank me.

spartanatreyuyesterday at 11:33 PM

You definitely need a gif or apng file showing it's use in the github readme.

And a link to an asciicinema would help a lot too.

---

Also, I'm not sure how useful the side-by-side view is.

The second example (https://github.com/flamestro/deff/blob/main/docs/example_02....) is confusing.

The left side has lines 1365-1371 having the same code as lines 1374-1380 on the right side, yet they're not aligned with each other.

Most diff views would put padding between lines 1364-1365 on the left side so lines 1365-1371 are aligned with 1374-1380 on the right side.

ZoomZoomZoomyesterday at 7:30 PM

Why shouldn't this be a simple wrapper to tie Delta to some kind of file browser or a thing like television[1]?

[1]: https://alexpasmantier.github.io/television/

show 1 reply
tty456today at 1:16 AM

So, basically 'vim -d' in rust? cool

yottamusyesterday at 7:13 PM

    git difftool --tool=vimdiff
show 2 replies
agavrayesterday at 11:42 PM

I just built a version of this a month ago that also allows you to add review comments so you can export them back to an Agent to fix: https://github.com/agavra/tuicr

Great work on deff, would love to brainstorm here :)

raphinouyesterday at 8:03 PM

Looks interesting. I'm currently using https://tuicr.dev/ , of which I like that the first screen it shows is the choice of commit range you want to review. Might be something to consider for deff?

jamiecodeyesterday at 7:28 PM

The specific gap side-by-side covers for me is reviewing changes on a remote box without firing up an IDE. Delta is great but keeps the unified format. icdiff does the split view but is pretty barebones. So there's definitely space here.

What nobody's mentioned yet is difftastic. Takes a completely different approach - parses syntax trees instead of lines, so indentation changes and bracket shuffles don't show up as noise. Worth a look if you're comparing options.

Main question I'd have: how does it hold up on large files? 5k+ line diffs are where most of these tools either choke or produce unreadable output. That'd be the test I'd run first.

show 2 replies
ivanjermakovtoday at 12:36 AM

8 terminal lines are taken by the tool's UI. Could have been 2.

teddyhyesterday at 7:39 PM

  emacs --eval='(ediff-files "file1" "file2")'
(The “|” key toggles side-by-side view.)
show 2 replies
hatradiowigwamyesterday at 8:14 PM

vimdiff is pretty fast, and is likely installed on your linux system without you realizing it.

show 1 reply
greatgibyesterday at 9:51 PM

It blows my mind that nowadays, some random tools on internet tells you to do "curl -fsSL https://.... | bash" to install some "binary" things and a lot of people will do it without hesitation.

It probably explains why there is so many data leaks recently but it is like we did a 20 years jump back in time in terms of security in just a few years.

show 4 replies
zemyesterday at 10:14 PM

will this play well with jj?

insane_dreameryesterday at 8:29 PM

we need something like this in lazygit -- which is excellent all around but lacking in visual diffing/merging.

What is most useful though is a 3-panel setup, like JetBrains -- still the best git client I have worked with.

show 1 reply
dec0dedab0deyesterday at 9:12 PM

looks pretty good at a glance, though I would like to see three views for handling conflicts. Target on the left, source on the right, and the combined result in the middle.

...I really just like the way the Jetbrains IDEs do it, and I wish there were a TUI version that I could launch automatically from the git cli.