7 ms·
Show HN: Deff – Side-by-side Git diff review in your terminal
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
- yottamus 7mo agogit difftool --tool=vimdiff
- metalliqaz 7mo agobut is it blazingly fast?
- syngrog66 7mo agoif its not in Rust or browser-based or a "cloud" service or the result of multi-GWH of LLM "training" or a VSCode plugin or ideally all of the prior then the HN kids wont be interested :-)
- flamestro 7mo agoI personally find vimdiff a bit harder to navigate for my usecase. The reason is that I am context unaware of the file often in larger projects and wanted something that allows me to check all lines in a touched file. However, I have to admit vimdiff comes quite close to what I need and is a great tool!
- PhilipRoman 7mo agozr? vim folds are fully programmable. For me a bigger issue was git calling vimdiff for each file, which I fixed with my own difftool: https://gist.github.com/PhilipRoman/60066716b5fa09fcabfa6c95eaf7d170 https://gist.github.com/PhilipRoman/60066716b5fa09fcabfa6c95...
- anitil 7mo agoI ran in to a couple problems when trying that script (details below), but I'm really happy that you shared it, because I had not seen ':windo diffthis' before, and that method of scripting diffs. I'll definitely be customising it! (I found that my mac machine doesn't support the '-printf' option, and also I was attempting to run 'git bvd main' on a branch but it seems it does a recursive directory diff, so I'll use 'git diff --name-only' as the input to the awk command). Edit: worked nicely! I haven't used tabs much in vim so is a slightly new workflow but otherwise very handy
- devnonymous 7mo ago> For me a bigger issue was git calling vimdiff for each file, If you configure vimdiff as the difftool in your git config, just doing a `git diff` would show you the diff for each file sequentially.
- jbaber 7mo agoI wrote a script that takes two git commits and opens all changed files in vimdiff tabs side by side. I find lots of things too hard to see in github gui. It depends one [tpope's vim-fugitive]. [tpope's vim-fugitive]: https://github.com/tpope/vim-fugitive https://github.com/tpope/vim-fugitive I'll paste it next time I'm on that machine.
- jbaber 7mo agoI tried to clean it up and put it [on sourcehut] and [on github]. [on sourcehut]: https://git.sr.ht/~jbaber/shadiff https://git.sr.ht/~jbaber/shadiff [on github]: https://github.com/jbaber/shadiff https://github.com/jbaber/shadiff
- meain 7mo agoI have been using https://github.com/jeffkaufman/icdiff https://github.com/jeffkaufman/icdiff for the longest time to get side by side diffs.
- lf-non 7mo agoI also use icdiff, but it is good to have the file-awareness for git diff esp. the ability to quickly skip files that I know aren't important.
- Amorymeltzer 7mo agoFor that in particular, I use delta (<https://github.com/dandavison/delta https://github.com/dandavison/delta>) with `side-by-side = true` enabled. I find I use both icdiff and delta side-by-side on a regular basis.
- behnamoh 7mo agoDelta is so much faster than icdiff too.
- flamestro 7mo agoThis looks great as well! I personally prefer a bit more context. Thats why I added a bit more of it to deff. It also allows to mark files as reviewed by pressing `r` which is quite handy for my flow.
- rileymichael 7mo agogetting 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 https://github.com/dandavison/delta) while still using the familiar git frontend
- greaakdls 7mo ago[flagged]
- llbbdd 7mo agoI 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/ https://github.com/dandavison/delta/
- kodomomo 7mo agoOcto [0] for nvim lets you submit reviews, add comments on ranges, reply to threads, etc. This in conjunction with gh-dash [1] to launch a review can get you a pretty nice TUI review workflow. [0] https://github.com/pwntester/octo.nvim https://github.com/pwntester/octo.nvim [1] https://github.com/dlvhdr/gh-dash https://github.com/dlvhdr/gh-dash *Edit: I see you meant providing feedback to an agent, not a PR. Well that's what I get for reading too fast.
- llbbdd 7mo agoNo problem, I appreciate another reason to look at Neovim; I do sometimes have a need to interact with GH's actual PR flow and once I've moved the rest of my workflow out of VSCode, Neovim looks like the best option for the last mile of actually writing and editing code. I just have to commit the time to set it up with everything I probably take for granted in VSCode's editor.
- Imustaskforhelp 7mo agoMicro editor is a great choice as well imo but I don't think that micro has the thriving plugin ecosystem as compared to neovim but it is possible to make plugins for micro editor as well https://github.com/micro-editor/plugin-channel https://github.com/micro-editor/plugin-channel Link to Micro editor: https://micro-editor.github.io/ https://micro-editor.github.io/
- jamiecode 7mo ago[dead]
- rileymichael 7mo agodelta supports split view: https://dandavison.github.io/delta/side-by-side-view.html https://dandavison.github.io/delta/side-by-side-view.html
- flamestro 7mo agoSo I tested this on huge files (checking cargo lock for instance) and it is super fast in the navigation of those. Until now I did not encounter any issue with bigger files (around 4k-6k changes but also only 4k-6k lines).
- ZoomZoomZoom 7mo agoWhy 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/ https://alexpasmantier.github.io/television/
- syngrog66 7mo agotelevision??
- teddyh 7mo agoemacs --eval='(ediff-files "file1" "file2")' (The “|” key toggles side-by-side view.)
- deleted 7mo ago[deleted]
- k_bx 7mo agoWhat 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"
- raphinou 7mo agoLooks interesting. I'm currently using https://tuicr.dev/ 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?
- hatradiowigwam 7mo agovimdiff is pretty fast, and is likely installed on your linux system without you realizing it.
- flamestro 7mo agoIts a great tool, but misses some of the context I needed.
- insane_dreamer 7mo agowe 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.
- flamestro 7mo agoWhat would the third panel contain in this case? Do you mean the setup that IntelliJ has in merge conflicts?
- insane_dreamer 7mo agoyes, it shows the final merge (what was accepted from the left and right panels); very handy
- lolive 7mo agounfortunately for terminal lovers, the best .gitconfig snippet is still this: [diff] tool = intellij [difftool "intellij"] cmd = idea diff \"$LOCAL\" \"$REMOTE\" [merge] tool = intellij [mergetool "intellij"] cmd = idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\" trustExitCode = true
- dec0dedab0de 7mo agolooks 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.
- greatgib 7mo agoIt 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.
- flamestro 7mo agoI get the hesitation :D But the code is open and the install.sh is as minimal as it gets tbh. Still, as said, I get the hesitation. What a time to be alive. It does not install binaries, it builds the binary by checking out the project basically. You can also do the process manually and use the tool.
- warkdarrior 7mo ago> But the code is open and the install.sh is as minimal as it gets tbh. I bet 99.9999% of users do not review the code nor the install script.
- holoduke 7mo agoCowboys rule the internet.
- pwdisswordfishy 7mo agoOne day folks who live inside commandlines and TUIs all day will realize that there's nothing particular about webapps or the sandboxes that they execute in that requires we build exclusively graphical runtimes around them, instead of taking advantage of the same security and distribution model for programs accessible and usable from within terminal emulator.
- jaden 7mo agoIs it that different from downloading and running a binary?
- greatgib 7mo ago
- zem 7mo agowill this play well with jj?
- meain 7mo agoYup, this seems to work pretty well with jj
- suralind 7mo agoWhat you want is difftastic. No need to thank me.
- spartanatreyu 7mo agoYou 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.png 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.
- agavra 7mo agoI 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 https://github.com/agavra/tuicr Great work on deff, would love to brainstorm here :)
- ivanjermakov 7mo ago8 terminal lines are taken by the tool's UI. Could have been 2.
- tty456 7mo agoSo, basically 'vim -d' in rust? cool
- sourcegrift 7mo agoDoes it show moved codeblocks like reviewboard. Is that the second screenshot
- esafak 7mo agoAny chance of binstall support? https://github.com/cargo-bins/cargo-binstall https://github.com/cargo-bins/cargo-binstall
- riteshyadav02 7mo ago[dead]
- toastal 7mo agokitty terminal has diff like this builtin https://sw.kovidgoyal.net/kitty/kittens/diff/ https://sw.kovidgoyal.net/kitty/kittens/diff/ I use it with darcs diff --diff-command="kitten diff %1 %2"
- tmarice 7mo agoNice, I did not know about this! I feel Kitty doesn't get enough love, it's all ghostty this, ghostty that, but Kitty has been my top performing terminal emulator for 10 years now.
- toastal 7mo agoI tried looking at the Ghostty homepage & it doesn’t even work without JavaScript so you can’t use a TUI web browser.
- xmorse 7mo agoCheck out Critique too if you are looking for a side by side diffs TUI It uses opentui, the same framework uses by opencode. It can also render diffs to images, pdf and html. Very useful for agents to share diffs in remote environments like Openclaw or Kimaki https://github.com/remorses/critique https://github.com/remorses/critique
- def13 7mo agoI’m not really sure what would pull me away for a vim based solution for viewing diffs (current using codediff.nvim). For a git client in general, I use a cli/tui based solution (lazygit or plain git depending on what I need to do) but when it comes to directly manipulating text why would I throw away all the muscle memory and custom configuration of my editor for a comparatively bare bones standalone tui?
- vindin 7mo agoLearn to read canonical diffs. It is the standard and will get you further than any new tool
- Jenk 7mo agodiff --side-by-side or use `-y` for short-hand.