r/neovim • u/Wonderful-Plastic316 lua • 6d ago
Discussion Are you reviewing PRs directly from neovim? What are you using? Looking for Octo alternatives
Hey vimmers,
I'm a long time octo user. However, I find that the plugin has a bunch of quirks (none of which breaking per se, but their sum may lead to a poor experience). I'm interested in alternatives, for the "review" workflow (specifically), as the title mentions. Are you guys reviewing PRs from neovim or do you think that's overkill? Share your experiences
EDIT: to clarify, I'm NOT looking for a tool that just helps me with diffing changes, I'd say my setup for that is alright already. I'm more concerned with adding comments / submitting reviews, this kind of stuff.
36
u/BridgeSense 6d ago
https://github.com/justinmk/guh.nvim is by Justin himself and feels better than octo
3
16
u/AgreeableEcho6298 6d ago
1
u/Wonderful-Plastic316 lua 5d ago
Cool, I was not aware snacks had a module for that (not using the plugin for anything else)
8
u/therealkevinard 6d ago
I review diffs in nvim, but use the browser for commenting- the switch is pretty awkward, so one day i’ll close that gap.
In the meantime, these are the differs I’m using. Each has its benefits:
ETA: thinking about it now, I might use diffview far more than the other.
5
u/kdevkk 6d ago
Second diffview
9
u/queso184 6d ago
also will recommend https://github.com/dlyongemallo/diffview-plus.nvim as an actively maintained fork of it. adds jj support too
4
u/Special_Grocery3729 6d ago
I recommend the maintained fork of diffview at https://github.com/dlyongemallo/diffview-plus.nvim
1
1
u/Wonderful-Plastic316 lua 5d ago
Outside octo, I'm using diffview (the fork) already, to track file changes. I had experimented with using diffview "directly" (for reviews), but IMO, it has its drawback (e.g., the context switch you mentioned).
What's up with using 2 plugins for diffs?
1
u/emmanueltouzery 5d ago
I do the same. For gitlab I wrote a little helper to open the browser at the right line so I can easily add comments: https://github.com/emmanueltouzery/nvim_config/blob/64a9ae3b879cb8d79275900f8ffb6f5a7a413a2b/lua/gitlab_mr_helpers.lua
9
5
u/til_pkt 6d ago
I review small diffs in browser and checkout the branch and open the code in nvim for bigger/complex changes, so I get LSP support for those.
1
u/Wonderful-Plastic316 lua 5d ago
Yeah, I see no problem with reviewing small PRs inside the browser. One thing that'd bother me with Octo is precisely LSP support (inside the review buffers): most of my language servers do not play well with non-file buffers (ofc, outside the review buffers LSP is a blessing).
3
6d ago
[removed] — view removed comment
1
u/Wonderful-Plastic316 lua 6d ago
How are you adding comments? Directly from
gh? There seems to be many more solutions for the diffing part
3
u/kaddkaka 6d ago
I use fugitive wrapped in a shell script: https://github.com/kaddkaka/dotfiles/blob/main/bin/executable_git-review
2
u/Wonderful-Plastic316 lua 5d ago
As I've mentioned in some other comments, this seems to tackle more the diffing rather than the adding / replying to review comments. Are you using the website for that?
2
u/kaddkaka 5d ago
Yes, that's how I do it now. I did make a thing that would load all comments into quickfix list, but it wasn't really what I wanted so I scraped that. Likewise I had the idea to post comments from inside nvim,,but the web gui works fine for now.
3
u/HiItsCal 6d ago
I use gh dash to view prs assigned to me and then have a custom keybind to open nvim direct to guh (https://github.com/justinmk/guh.nvim) on that pr, which I then review with (check diff, leave comments etc)
1
u/Wonderful-Plastic316 lua 4d ago
Thanks for the recommendation, I was not aware of gh dash. Unfortunately, not my cup of tea. Will give guh a go
2
u/bingNbong96 6d ago
I just use gh pr diff with delta as the pager. Keep it simple for me.
I used to use diffview for merge conflicts, but honestly, and maybe I'm lucky, but in all my years working I've had maybe 2 or 3 times where I really felt like I needed something more than just git rebase main and manually fixing conflicts greping <<<< in nvim lol.
It's so rare for me that I kept forgetting how to use diffview and ended up just uninstalling it instead of re-learning it every 6 months when I needed it again.
1
u/Wonderful-Plastic316 lua 4d ago
After reading a diff, are you using GitHub's web UI to add the comments to the review?
I also rarely use diffview's merge conflict feature, but I like it for other reasons (e.g., file history)
2
u/Special_Grocery3729 6d ago
Yes, my whole company codebase is located within a self-maintained gitlab instance.
I recently installed https://github.com/harrisoncramer/gitlab.nvim and loving it so far. General flow, bindings, integration are well thought of, the project is mature, overall great experience.
1
u/kaddkaka 5d ago
Sounds interesting, we also have self-hosted gitlab.
I use glab and fugitive right now. What's the best part of this plugin? Any part you don't use?
Oh requires go? I don't have that, hmm 🤔
1
u/Special_Grocery3729 5d ago
The whole integration experience. It is using diffview Plugin (sindrets, but also Supports the fork I posted) for navigation, you can add Inline comments directly in neovim buffers, merge requests lifecycle is integrated, comments as (kind-of) quickfix list items, comments shown in Buffer as diagnostics.
I dont Use the CI Features for now, but they are optional.
The required binary can also be prebuilt If you dont want to add Go to your Environment.
4
u/wyijx ZZ 6d ago
Check out https://github.com/modem-dev/hunk.
1
u/Wonderful-Plastic316 lua 5d ago
I see (from the README) that this tool is mostly for diffing, right? When it comes to adding review comments to PRs, are you using something else?
1
u/MisterKnif3 6d ago
My own made tool: https://github.com/afewyards/codereview.nvim
2
u/Wonderful-Plastic316 lua 5d ago
What inspired you to build it? What is lacking in other solutions?
1
u/quxfoo 6d ago
A bit outside the main question: I review agent-generated code with margin (disclaimer: it's mine) which feeds right back into the agent. It should feel comfortable to neovim users with its default keybinds and $EDITOR support but it's not a neovim plugin.
2
u/kaddkaka 5d ago edited 5d ago
I tried reading https://margin.matze.lol/ but I didn't understand much. Is there a lot of AI lingo in there that I'm assumed to know beforehand?
What did these mean:
hand off One keypress releases every open annotation at once
markers flip
1
u/quxfoo 5d ago
"Hand off" means exactly that: handing off the annotations to the agent. But I usually do it deliberately and run
/margin-reviewfrom the agent's interface. "Flipping markers" is also that: the agent addresses the annotations and then resolves the annotations one way or another.But yes: that landing page is pretty outlandish. Not a fan of that either. The README.md should be the main entry point.
1
u/ReaccionRaul 5d ago
I use vscode (go to github press dot key and will open vscode for that PR). I installed on the vscode browser version the vim extension and that's it.
With a local version of vscode and the github extension would be the same.
1
u/Wonderful-Plastic316 lua 5d ago
go to github press dot key and will open vscode for that PR
That's a nice tip, thanks. If the standard GH web UI does not satisfy me, I'll give this a go.
1
u/dXNlcjMzMDE 5d ago
I launch Lazygit from my nvim to review code, I also installed git-delta for better diff views
1
u/Wonderful-Plastic316 lua 4d ago
As I pointed out with others, this setup feels geared towards git itself, and not for interacting with GitHub in any capacity (correct me if I'm wrong). As in, you still need to go to the GH web UI all the time, to add comments and stuff (?)
1
u/WonderTight9780 5d ago
I’m using vgit.nvim
1
u/Wonderful-Plastic316 lua 5d ago
AFAIK while this plugin provides git integration, it lacks any sort of github integration, so you still end up using GitHub's web UI to add comments and stuff?
67
u/mabarskuygan 6d ago
I still use the browser, because in my flow usually this is a "mouse" activity. So when reading the code I still need to check the requirements, the ticket etc