FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.43k stars 636 forks source link

ungit not working at all (@ VSCode & node) #1402

Open fwornle opened 4 years ago

fwornle commented 4 years ago

Hi,

Tried to use 'ungit', both as "standalone service" (= running on windows/node.js [12.17.0, npm 6.14.4, git 2.27.0]) as well as plug-in for VS Code. The service seems to start alright I get some ungity output (either in VS Code or in the browser, via http://localhost:8448/). However, the message I get suggests that I'm using a folder in which no git repository can be found... the problem is that there is a git repository in this folder - I have no trouble interacting with the repo from the command line or via the VS Code git plugins. Tried this on a number of different git repos/folders... no luck - it persistently tells me that a repo is needed. When I click on "create repository", an error message is displayed (git-crash-error)

Possibly a configuration issue of sorts, or a bug - not sure.

Anyone out there with an idea of how I can get this to run? Thank you.

BR, Frank.

ungit-error

campersau commented 4 years ago

Can you please run the following commands inside your ddady folder and show us the output?

git rev-parse --is-inside-work-tree --is-bare-repository
git rev-parse --show-toplevel

Just for completness: Are you using this extension https://marketplace.visualstudio.com/items?itemName=Hirse.vscode-ungit ? And which version of it?

fwornle commented 4 years ago

Hi,

Here's the requested output:

PS C:_REPOS\git\metrics> git rev-parse --is-inside-work-tree --is-bare-repository true false PS C:_REPOS\git\metrics> git rev-parse --show-toplevel C:/_REPOS/git/metrics

And yes, I'm using this plug-in, V2.2.3

Thank you for your assistance.

campersau commented 4 years ago

Strange why does it say ddady is not a git repository instead of metrics? Did you open ungit in a subfolder or submodule?

fwornle commented 4 years ago

My bad - I had switched workspaces to try it out with a different repo.

PS C:_REPOS\git\ddady> git rev-parse --is-inside-work-tree --is-bare-repository true
false PS C:_REPOS\git\ddady> git rev-parse --show-toplevel C:/_REPOS/git/DDADy

Same story for DDADy though - are the results as you would expect them?

campersau commented 4 years ago

Yes, they look fine, we use them to detect git directories: https://github.com/FredrikNoren/ungit/blob/161a0398416b6651d73556c0ac0a7d836fbe7aea/source/git-promise.js#L569-L586

So not quite sure why this isn't detected properly but since we just suppress any errors here it will be hard to debug. https://github.com/FredrikNoren/ungit/blob/161a0398416b6651d73556c0ac0a7d836fbe7aea/source/git-promise.js#L585

fwornle commented 4 years ago

Hm... could give it a shot and try to debug this - but where would I have to look? Chrome dev tools show the following... any ideas / suggestions?

ungit-debug

campersau commented 4 years ago

I have added some more logging in https://github.com/campersau/ungit/commit/acb8ff1e86c88d72debd471dc92ad9dd0aeb1d4a you can download an electron build e.g. ungit-win32-x64 from https://github.com/campersau/ungit/actions/runs/170378455 and start the ungit.exe. Make sure to close VS Code to shut down the VS Code ungit plugin before that. Then open the View -> Toggle Developer Tools and navigate to the folder. If there is an error it should show up in the console under STATUS or ERROR.

fwornle commented 4 years ago

So, tried the provided build and, with this, I could get it to run. Still had an issue when the remote was unavailable (needed VPN), but with this resolved, I could see the commits/branches, etc. Took a while to get the data displayed though (30-60 seconds). Unfortunately, the VS Code plugin still exhibits the observed behavior (the repo is not recognized). Is there a possibility to debug the VS Code plugin too? Thanks.

campersau commented 4 years ago

The VS Code Plugin is maintained by @Hirse over here https://github.com/Hirse/vscode-ungit maybe he has some ideas of how to debug it?

fwornle commented 4 years ago

I'll create an issue there. Thanks for your help thus far.