20 comments

  • tty4562 minutes ago
    So, basically 'vim -d' in rust? cool
  • llbbdd5 hours ago
    I was looking for a good TUI tool for diffs recently, but I&#x27;m not sure yet if what I want exists already (and I don&#x27;t think this tool does it (yet?)). I&#x27;ve been moving my workflow out of VSCode as I&#x27;m using TUI-driven coding agents more often lately but one thing I miss from my VSCode&#x2F;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.<p>I admit I haven&#x27;t looked super hard yet, I settled on configuring git to use delta [0] for now and I&#x27;m happy with it, but I&#x27;m curious if anyone has a workflow for reviewing&#x2F;iterating on diffs in the terminal that they&#x27;d be willing to share. Also open to being told that I&#x27;m lightyears behind and that there&#x27;s a better mental model for this.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta&#x2F;</a>
    • kodomomo5 hours ago
      Octo [0] for nvim lets you submit reviews, add comments on ranges, reply to threads, etc.<p>This in conjunction with gh-dash [1] to launch a review can get you a pretty nice TUI review workflow.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;pwntester&#x2F;octo.nvim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pwntester&#x2F;octo.nvim</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;dlvhdr&#x2F;gh-dash" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dlvhdr&#x2F;gh-dash</a><p>*Edit: I see you meant providing feedback to an agent, not a PR. Well that&#x27;s what I get for reading too fast.
      • llbbdd3 hours ago
        No problem, I appreciate another reason to look at Neovim; I do sometimes have a need to interact with GH&#x27;s actual PR flow and once I&#x27;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&#x27;s editor.
    • thamer3 hours ago
      I had tried `delta` a few years ago but eventually went with `diff-so-fancy`[1]<p>The two are kind of similar if I remember correctly, and both offer a lot of config options to change the style and more. I mostly use it for diffs involving long lines since it highlights changes <i>within</i> a line, which makes it easier to spot such edits.<p>I have an alias set in `~&#x2F;.gitconfig` to pipe the output of `git diff` (with options) to `diff-so-fancy` with `git diffs`:<p><pre><code> diffs = &quot;!f() { git diff $@ | diff-so-fancy; }; f&quot; </code></pre> [1] <a href="https:&#x2F;&#x2F;github.com&#x2F;so-fancy&#x2F;diff-so-fancy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;so-fancy&#x2F;diff-so-fancy</a>
      • petepete2 hours ago
        You can do this with diff-highlight, which comes packaged with git. No extra packages needed.
    • agavra1 hour ago
      Checkout <a href="https:&#x2F;&#x2F;github.com&#x2F;agavra&#x2F;tuicr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;agavra&#x2F;tuicr</a> - it&#x27;s built exactly for this purpose (reviewing code in your terminal and then adding comments and exporting it to an agent to fix).
    • flamestro3 hours ago
      I was also searching for some time, but most of them did not have enough context for my workflow tbh. So thats why I decided to make deff. Another good one I liked is vimdiff
    • mckn1ght4 hours ago
      I use delta for quick diffs in a shell (along with the -U0 option on git-diff), but in my claude workflow, i have a 3 pane setup in tmux: :| where the right side is a claude session, the top left is emacs opened to magit, and the bottom left is a shell. Magit makes navigating around a diff pretty easy (as well as all the other git operations), and I can dive into anything and hand edit as well.
    • jfyne4 hours ago
      Not TUI based but I made something called meatcheck. The idea being that the LLM requests a review from the human, you can leave inline comments like a PR review.<p>Once you submit it outputs to stdout and the agent reads your comments and actions them.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jfyne&#x2F;meatcheck" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jfyne&#x2F;meatcheck</a>
      • llbbdd3 hours ago
        Thank you! At a glance this is very close to what I had in mind, especially with the straightforward output format, I&#x27;ll give this a try.
    • coryrc4 hours ago
      magit
  • k_bx5 hours ago
    What I would love to see is &quot;tig&quot; replacement that is:<p>- even faster, especially if you have couple thousand files and just want to press &quot;u&quot; for some time and see them very quickly all get staged<p>- has this split-view diff opened for a file<p>Otherwise tig is one of my favorite tools to quickly commit stuff without too many key presses but with review abilities, i have its &quot;tig status&quot; aliased to &quot;t&quot;
  • meain6 hours ago
    I have been using <a href="https:&#x2F;&#x2F;github.com&#x2F;jeffkaufman&#x2F;icdiff" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jeffkaufman&#x2F;icdiff</a> for the longest time to get side by side diffs.
    • lf-non6 hours ago
      I 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&#x27;t important.
      • Amorymeltzer5 hours ago
        For that in particular, I use delta (&lt;<a href="https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta</a>&gt;) with `side-by-side = true` enabled. I find I use both icdiff and delta side-by-side on a regular basis.
        • behnamoh5 hours ago
          Delta is so much faster than icdiff too.
    • flamestro4 hours ago
      This 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.
  • rileymichael6 hours ago
    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 <a href="https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta</a>) while still using the familiar git frontend
  • spartanatreyu1 hour ago
    You definitely need a gif or apng file showing it&#x27;s use in the github readme.<p>And a link to an asciicinema would help a lot too.<p>---<p>Also, I&#x27;m not sure how useful the side-by-side view is.<p>The second example (<a href="https:&#x2F;&#x2F;github.com&#x2F;flamestro&#x2F;deff&#x2F;blob&#x2F;main&#x2F;docs&#x2F;example_02.png" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;flamestro&#x2F;deff&#x2F;blob&#x2F;main&#x2F;docs&#x2F;example_02....</a>) is confusing.<p>The left side has lines 1365-1371 having the same code as lines 1374-1380 on the right side, yet they&#x27;re not aligned with each other.<p>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.
  • suralind2 hours ago
    What you want is difftastic. No need to thank me.
  • agavra1 hour ago
    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: <a href="https:&#x2F;&#x2F;github.com&#x2F;agavra&#x2F;tuicr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;agavra&#x2F;tuicr</a><p>Great work on deff, would love to brainstorm here :)
  • ZoomZoomZoom5 hours ago
    Why shouldn&#x27;t this be a simple wrapper to tie Delta to some kind of file browser or a thing like television[1]?<p>[1]: <a href="https:&#x2F;&#x2F;alexpasmantier.github.io&#x2F;television&#x2F;" rel="nofollow">https:&#x2F;&#x2F;alexpasmantier.github.io&#x2F;television&#x2F;</a>
  • ivanjermakov42 minutes ago
    8 terminal lines are taken by the tool&#x27;s UI. Could have been 2.
  • yottamus6 hours ago
    <p><pre><code> git difftool --tool=vimdiff</code></pre>
    • flamestro4 hours ago
      I 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!
      • PhilipRoman3 hours ago
        zr?<p>vim folds are fully programmable. For me a bigger issue was git calling vimdiff for each file, which I fixed with my own difftool: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;PhilipRoman&#x2F;60066716b5fa09fcabfa6c95eaf7d170" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;PhilipRoman&#x2F;60066716b5fa09fcabfa6c95...</a>
        • anitil1 hour ago
          I ran in to a couple problems when trying that script (details below), but I&#x27;m really happy that you shared it, because I had not seen &#x27;:windo diffthis&#x27; before, and that method of scripting diffs. I&#x27;ll definitely be customising it!<p>(I found that my mac machine doesn&#x27;t support the &#x27;-printf&#x27; option, and also I was attempting to run &#x27;git bvd main&#x27; on a branch but it seems it does a recursive directory diff, so I&#x27;ll use &#x27;git diff --name-only&#x27; as the input to the awk command).<p>Edit: worked nicely! I haven&#x27;t used tabs much in vim so is a slightly new workflow but otherwise very handy
    • metalliqaz5 hours ago
      but is it blazingly fast?
      • syngrog665 hours ago
        if its not in Rust or browser-based or a &quot;cloud&quot; service or the result of multi-GWH of LLM &quot;training&quot; or a VSCode plugin or ideally all of the prior then the HN kids wont be interested :-)
  • raphinou5 hours ago
    Looks interesting. I&#x27;m currently using <a href="https:&#x2F;&#x2F;tuicr.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tuicr.dev&#x2F;</a> , 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?
  • jamiecode5 hours ago
    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&#x27;s definitely space here.<p>What nobody&#x27;s mentioned yet is difftastic. Takes a completely different approach - parses syntax trees instead of lines, so indentation changes and bracket shuffles don&#x27;t show up as noise. Worth a look if you&#x27;re comparing options.<p>Main question I&#x27;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&#x27;d be the test I&#x27;d run first.
    • flamestro4 hours ago
      So 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).
    • rileymichael4 hours ago
      delta supports split view: <a href="https:&#x2F;&#x2F;dandavison.github.io&#x2F;delta&#x2F;side-by-side-view.html" rel="nofollow">https:&#x2F;&#x2F;dandavison.github.io&#x2F;delta&#x2F;side-by-side-view.html</a>
  • teddyh5 hours ago
    <p><pre><code> emacs --eval=&#x27;(ediff-files &quot;file1&quot; &quot;file2&quot;)&#x27; </code></pre> (The “|” key toggles side-by-side view.)
  • greatgib3 hours ago
    It blows my mind that nowadays, some random tools on internet tells you to do &quot;curl -fsSL https:&#x2F;&#x2F;.... | bash&quot; to install some &quot;binary&quot; things and a lot of people will do it without hesitation.<p>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.
    • flamestro3 hours ago
      I 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.<p>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.
      • warkdarrior3 hours ago
        &gt; But the code is open and the install.sh is as minimal as it gets tbh.<p>I bet 99.9999% of users do not review the code nor the install script.
    • pwdisswordfishy2 hours ago
      One day folks who live inside commandlines and TUIs all day will realize that there&#x27;s nothing particular about webapps or the sandboxes that they execute in that <i>requires</i> 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.
    • jaden2 hours ago
      Is it that different from downloading and running a binary?
    • holoduke3 hours ago
      Cowboys rule the internet.
  • hatradiowigwam5 hours ago
    vimdiff is pretty fast, and is likely installed on your linux system without you realizing it.
    • flamestro4 hours ago
      Its a great tool, but misses some of the context I needed.
  • zem3 hours ago
    will this play well with jj?
  • insane_dreamer4 hours ago
    we need something like this in lazygit -- which is excellent all around but lacking in visual diffing&#x2F;merging.<p>What is most useful though is a 3-panel setup, like JetBrains -- still the best git client I have worked with.
    • flamestro4 hours ago
      What would the third panel contain in this case? Do you mean the setup that IntelliJ has in merge conflicts?
  • dec0dedab0de4 hours ago
    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.<p>...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.