obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: No activity or message if .git/index.lock exists

Open HaleTom opened this issue 3 years ago • 2 comments

Describe the bug

I noticed that my git "backups" weren't happening.

I saw no output at all in Obsidian. Strangely, my obsidian-git settings had returned to their defaults???

Relevant errors (if available)

Running a git command manually generated this message:

fatal: Unable to create '/home/ravi/doc/obsidian/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

Steps to reproduce

I'm guessing a:

touch .git/index.lock

Would do it. But I didn't create this file it the first place. Maybe it happened because git died ungracefully?

Expected Behavior

A warning message that the operations of obsidian-git couldn't proceed, mentioning .git/index.lock.

Addition context

No response

Operating system

Linux

HaleTom avatar Feb 16 '22 12:02 HaleTom

I just noticed this in the console:

Uncaught (in promise) Error: fatal: Unable to create '/home/ravi/Documents/obsidian/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

    at Object.action (eval at <anonymous> (app.js:1), <anonymous>:2120:29)
    at PluginStore.exec (eval at <anonymous> (app.js:1), <anonymous>:2155:29)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2594:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (eval at <anonymous> (app.js:1), <anonymous>:2592:16)
    at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2576:44)
    at Generator.next (<anonymous>)
    at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:2496:28)

It would be great to have a popup message on error :)

HaleTom avatar Feb 16 '22 12:02 HaleTom

I can't reproduce. Which command do you call? Does commit all changes work? (Show the error message). When I add the file via touch I get an error notification.

Vinzent03 avatar Feb 19 '22 10:02 Vinzent03