Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should I be seeing something in the NeogitStatus buffer? #47

Closed
orestis opened this issue Mar 1, 2021 · 10 comments
Closed

Should I be seeing something in the NeogitStatus buffer? #47

orestis opened this issue Mar 1, 2021 · 10 comments

Comments

@orestis
Copy link

orestis commented Mar 1, 2021

Hi there, I'm using the master version on a days-old NeoVim 0.5 and issuing :NeoGit opens up a new tab with an empty buffer. The various commands listed in the help bring up some other buffers but nothing ever shows up on the NeoGit buffer. ctrl-r doesn't do anything or bring up an error message.

I'm happy to add more diagnostics if I can find out how to generate them :)

Thanks for putting this out there, I'm currently using vim-fugitive but it's not ideal...

@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

As long as your working directory is in a git repository, yes you should :D handling outside a git repo is suboptimal at best.
Any errors in the message history?

@orestis
Copy link
Author

orestis commented Mar 1, 2021

The working directory (as returned by :pwd) is indeed a git repo.

No errors that I can see in :messages ...

@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

Alright. We don't really have good diagnostics yet, but there's a few things you can do to help me find the issue:

  • what operating system are you using?
  • depending on how your Plugin manager operates, if it cloned the repository, can you give me the checked out commit Hash? You can also just update so we're on the same page (we merged a bigger chunk just before you opened the issue)
  • if you're on a non-windows machine, follow the steps in the readme to run the testsuite.
    Otherwise you can also clone the repo, navigate to tests/.repo, copy .git.orig to .git and open nvim and neogit there (basically doing the tests manually)
  • in the neogit status buffer, press $ to see if you can at least open the command history

@orestis
Copy link
Author

orestis commented Mar 1, 2021

OK some progress. Running the tests didn't work; The output was:

nvim --headless --noplugin -c "lua require(\"plenary.test_harness\").test_directory_command('tests/ {minimal_init = \"tests/minimal-init.nvim\"}')"
Starting...Scheduling: tests//poc_spec.lua
Scheduling: tests//hunks_spec.lua
Scheduling: tests//status_buf_spec.lua
make: *** [test] Error 1

I tried disabling all the tests except the POC but then I got a require error about plenary.busted (I have plenary installed, not sure what the error is). I moved on to run the manual steps and it did work!

I narrowed it down to either a Neovim version or my GUI (VimR - I'm on macOS):

On the terminal, where it works, the Neovim version is v0.5.0-dev+nightly. Homebrew mentions HEAD-dc3ca16_1...

Inside VimR, where it doesn't work, the version is v0.5.0-dev+dev-nvimserver-universal-8-gd258bb2ba

The usual suspects here is usually environment issues. I will browse the source code and see if I can spot anything.

@orestis
Copy link
Author

orestis commented Mar 1, 2021

I tried to figure out a way to diagnose this but my lua skills are pretty much non-existent. Any pointers appreciated, the async stuff is throwing me off :) If I can get a way to print the result of a function I could perhaps help a bit more:

local status = require('neogit.lib.git.status')
-- this prints function: 0x01078c4230
print(status.get())
-- this prints nothing
print(status.get()())

@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

the async stuff is throwing me off :)

Don't worry, I only half-understand it myself, co routines yielding functions is pretty involved :D
The async stuff is based on this amazing tutorial, which can probably explain it way better than me: https://github.com/ms-jpq/neovim-async-tutorial
But the gist is that the "async" methods are partially applied, so the second invocation takes only the continuation callback. So you have a couple of options:

status.get()(function (result) ... end) -- manually binding a callback to the continuation
local a = require('neogit.async')
a.run(status.get) -- helper function that pretty much does the above with an empty function, no way to get the result though
a.dispatch(function ()
  local result = a.wait(status.get())
  ...
end) -- "canonical" way, dispatch wraps it's argument with the execution engine and invokes it.

I have another hunch though:
When you start neovim from the terminal it works, but also you're in the correct working directory already.
When you start VimR though, you have to manually :cd into the correct directory before, right? If so, that might be related to the problem

RianFuro added a commit to RianFuro/neogit that referenced this issue Mar 1, 2021
If the status refresh is cut short, we still need to update the refresh
flag, so the returned wait callback does the right thing
@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

@orestis Can you check if a plugin update fixes the problem for you?

@RianFuro
Copy link
Contributor

RianFuro commented Mar 1, 2021

I got a require error about plenary.busted

btw, this could mean that your plenary plugin is outdated, they switched to their own busted port pretty recently

@orestis
Copy link
Author

orestis commented Mar 2, 2021

Yay, after an update I'm seeing things in the Neogit buffer :) Thanks for the help.

@orestis orestis closed this as completed Mar 2, 2021
@RianFuro
Copy link
Contributor

RianFuro commented Mar 2, 2021

@orestis Glad I could help, thank you for your time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants