pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.25k stars 124 forks source link

Error when cycling through changed files #439

Closed bolt12 closed 2 months ago

bolt12 commented 8 months ago

Issue Description

Type: bug report

Describe what happened (or what feature you want)

When reviewing a PR and cycling through changed files with [q or ]q I get an error for some particular files.

Before pressing ]q: image

after:

image

Describe what you expected to happen

It should go to the next changed file without an error

How to reproduce it (as minimally and precisely as possible)

  1. review: https://github.com/input-output-hk/ouroboros-network/pull/4644
  2. cycle through changed files
  3. error
Danthewaann commented 3 months ago

I have the same problem. I've found that running git diff manually with the commit range that octo uses for the commit to review returns an error like so:

$ git diff a6ca7c6..fa4aef9
fatal: ambiguous argument 'a6ca7c6..fa4aef9': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

So this is likely what is causing your problem too.

Danthewaann commented 3 months ago

Actually I think I now what the problem is.

After just running git pull locally and then re-running :Octo review commit and selecting the commit that was failing before it now successfully views it without throwing up any error.

So you need to make sure your local copy of the PR branch is up to date with the remote one it seems.