logseq-plugin-git icon indicating copy to clipboard operation
logseq-plugin-git copied to clipboard

Unable to access .git/config

Open pirachute opened this issue 1 year ago • 18 comments

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 avatar Dec 29 '23 11:12 pirachute

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!

pirachute avatar Dec 30 '23 10:12 pirachute

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

alwinnat avatar Dec 31 '23 10:12 alwinnat

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  [email protected]:my_user/my_graph.git (fetch)
origin  [email protected]: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 avatar Dec 31 '23 13:12 pirachute

I continue getting a constant stream of these errors:

image

pirachute avatar Dec 31 '23 13:12 pirachute

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!

alwinnat avatar Dec 31 '23 17:12 alwinnat

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!

pirachute avatar Jan 01 '24 15:01 pirachute

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

pranaysy avatar Jan 01 '24 17:01 pranaysy

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'.

alwinnat avatar Jan 03 '24 14:01 alwinnat

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

i--storm avatar Jan 04 '24 16:01 i--storm

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.

DeeliN221 avatar Jan 05 '24 10:01 DeeliN221

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 avatar Jan 10 '24 21:01 clindsay-ol

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 avatar Jan 10 '24 21:01 clindsay-ol

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.

clindsay-ol avatar Jan 10 '24 21:01 clindsay-ol

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 avatar Jan 17 '24 05:01 StepanKuklis

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

StepanKuklis avatar Jan 18 '24 04:01 StepanKuklis

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

AI-Ahmed avatar Jan 18 '24 18:01 AI-Ahmed

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

gvlx avatar Jan 23 '24 21:01 gvlx

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!

AI-Ahmed avatar Jan 24 '24 11:01 AI-Ahmed