haydenull / logseq-plugin-git

A git plugin for logseq
MIT License
110 stars 20 forks source link

Unable to access .git/config #51

Open pirachute opened 6 months ago

pirachute commented 6 months ago

Hello,

On Windows 11 I get this error:

Unable to access .git/config

Screenshot 2023-12-29 123846

EDIT: I thought I had discovered the reason, but I didn't. :

I thought the plugin was not using the .git/config on my graphs folder:

C:\my_path\my_graph_folder\.git

Instead it was using a .git on the Logseq app folder:

C:\Users\my_user\.logseq\git\Ccomma_Users_my_user_Documents_Logseq_my_graph_name\.git

This folder was empty... when I copied the .git/config file on it, it stopped giving the error when I start Logseq, but after a while using it, it came back...

Any ideas on how to solve this problem?

pirachute commented 6 months ago

I can confirm that copying all the contents in the Graph's .git into the Logseq plugin's .git helps reduce the problem's rate, but doesn't entirely solve the problem... Still, it doesn't make sense having to manually set a copy of the .git folder somewhere else... I consider this a bug =P... I hope it helps!

alwinnat commented 6 months ago

Hello @pirachute,

I had the same issue. In my case an additional remote repository caused the problem. I created one locally which I deleted afterwards. But I forgot to remove it from the git configuration.

git remote -v

image

pirachute commented 6 months ago

Hi @alwinnat !

Thank you very much for your reply!! I used git remote -v and I don't seem to get any additional remote repositories.

I get this:

C:\my_graph_path> git remote -v
origin  git@github.com:my_user/my_graph.git (fetch)
origin  git@github.com:my_user/my_graph.git (push)

I also checked my .git/config and I see no references to other repositories...

I also tried adding full permissions for "Everyone", which in Windows is a very rare thing to do... still no luck.

Am I missing something?

pirachute commented 6 months ago

I continue getting a constant stream of these errors:

image

alwinnat commented 6 months ago

Hello @pirachute,

same here! It seems, there is a race condition problem with .git\config.

I took a look with Process Monitor and found following git commands, Logseq executes:

image

You can find it in the source code of Logseq at HERE.

I have no clue, why it is necessary to set core.safecrlf after every call of git status, commit, pull, ... . This is a question for the devs!

pirachute commented 6 months ago

Thanks @alwinnat ,

That's very weird indeed...

At least I'm not the only one with the problem hehe... I guess we'll wait for the devs to see what they say then.

In the meantime, happy new year!

pranaysy commented 6 months ago

I can confirm that I have the exact same issue on Logseq v0.10.3 running logseq-plugin-git v1.5.5 on Windows 10 with git v2.43.0.windows.1

alwinnat commented 6 months ago

Hello @pirachute and @pranaysy,

have a Happy New Year, too!

I did a little digging and found Issue #10743. Since then, there have been some fixes. I did some tests with a nightly build and did not get any errors regarding to '.git/config'.

i--storm commented 6 months ago

Confirm same error on Windows 11. It began to popup after last Logseq update

m3lab-zzl commented 6 months ago

Same error on Windows 10, it only occurs recently. I remember the new version > 0.10.1 made this plugin crashed for a few days before. Maybe related to that.

clindsay-ol commented 5 months ago

I've been having this issue on Windows 11 and troubleshooting it as well. This only started after recently updating LogSeq, so perhaps this is due to changes in the new version. Thanks for keeping tabs on it.

I'm not sure why it would be setting core.safecrlf manually every time either; since Git integration is an unsupported "Advanced" feature, I think it would be safe to assume everyone has properly set their CRLF configurations globally as needed.

clindsay-ol commented 5 months ago

For what it's worth, in my troubleshooting I have also seen that LogSeq seems to set some files in the repository to read-only while it is running.

Changing the version control setting for the built-in Git support requires restarting the app, so perhaps this is to prevent config changes from causing problems in a running instance of LogSeq? Food for thought.

clindsay-ol commented 5 months ago

With the Git plugin disabled and only the main integration enabled, I am now getting this error message:

image

I am assuming that the native integration now locks the file while LogSeq is running.

Update: core.bare = false is already explicitly set in my .git/config file for this repo.

StepanKuklis commented 5 months ago

Hello, I would gladly send a few bucks somewhere as a thanks for the plugin and the possibility of fixing this. The plugin is saving me time and making my life easier.

StepanKuklis commented 5 months ago

Just updated to Logseq 0.10.4 and the error is gone! (w10) (the offer of donation still lasts)

AI-Ahmed commented 5 months ago

Just updated to Logseq 0.10.4 and the error is gone! (w10) (the offer of donation still lasts)

But the problem still remaining, Git doesn't automatically push

gvlx commented 5 months ago

I had the exact same problem, but it has vanished since v0.10.5

I had remove the folder %USERPROFILE%\.logseq\git but it has been recreated. (why does it exists?)

AI-Ahmed commented 5 months ago

I had the exact same problem, but it has vanished since v0.10.5

I had remove the folder %USERPROFILE%\.logseq\git but it has been recreated. (why does it exists?)

The issue of commit & pushing is partially solved, but still, you have to commit & push manually!