Replies: 1 comment 3 replies
-
I'll admit, I tend to default to the GitHub web view, as that
This happens because |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I thought it would be nice to start a discussion around the various ways we use Fugitive to review code. I would love to be inspired with the various workflows that you might use day-to-day.
Ask yourself:
I'll kick off.
I tend to favour one giant diff reviews as that is usually how they're presented to me (for better or worse). I like to check out the branch for reviewing. This way I can play around with review suggestions before I raise them.
git fetch origin main topic-branch # get latest changes from both the trunk and branch git checkout topic-branch
One handy command in Fugitive is the
:h :Git_difftool
which I like to use with the-y
switch. This ends up looking like:which opens a new tab per file that has changed since this was branched from
main
. Each tab additionally contains a diff split showing the changes. I then scan through the tabs withgt
to go to the next tab orgT
to go back to the previous tab. Unfortunately, this approach has the limitation of purely infugitive:
style urls so doesn't benefit from an editable buffer or things like an LSP server providing diagnostics. I've worked around this with a command like:which, given that each tab defaults to selecting the more recently changed file, snaps that split back to the file that's on disk and then reapplies diff mode.
That about wraps up my best tricks. Love to hear what you've got!
Beta Was this translation helpful? Give feedback.
All reactions