Coder Social home page Coder Social logo

Comments (10)

RianFuro avatar RianFuro commented on June 21, 2024

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?

from neogit.

orestis avatar orestis commented on June 21, 2024

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

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

from neogit.

RianFuro avatar RianFuro commented on June 21, 2024

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

from neogit.

orestis avatar orestis commented on June 21, 2024

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.

from neogit.

orestis avatar orestis commented on June 21, 2024

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()())

from neogit.

RianFuro avatar RianFuro commented on June 21, 2024

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

from neogit.

RianFuro avatar RianFuro commented on June 21, 2024

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

from neogit.

RianFuro avatar RianFuro commented on June 21, 2024

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

from neogit.

orestis avatar orestis commented on June 21, 2024

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

from neogit.

RianFuro avatar RianFuro commented on June 21, 2024

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

from neogit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.