You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have buffers open for files tracked in a git repository vc-mode starts git processes whenever a file is externally modified. This have very unfortunate consequences when I git rebase as something like the following occurs,
rebase checks out a commit
emacs notices files changed, tells vc which then fires up a git ls-files command
git ls-files grabs the index lock
rebase tries to commit, sees that the index lock is taken, fails with,
fatal: Unable to create '/opt/exp/ghc/ghc-landing/.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
git ls-files finishes, releasing the lock
This is quite frustrating as it leaves your repository in an unknown state, which then requires careful gymastics to get out of.
Details
To work out what was responsible for emacs starting git processes I traced call-process invocations with,
I suspect spacemacs setting global-auto-revert-mode is the reason for this. I agree that this is a desirable default, but I don't see any way to make this safe in the face of external version control usage.
One imperfect solution would be to use some sort of hold-off strategy to defer running the vc-find-file-hook until the file appears idle. This will make this sort of race much less likely, although still possible.
If I have buffers open for files tracked in a git repository
vc-mode
startsgit
processes whenever a file is externally modified. This have very unfortunate consequences when Igit rebase
as something like the following occurs,vc
which then fires up agit ls-files
commandgit ls-files
grabs the index lockgit ls-files
finishes, releasing the lockThis is quite frustrating as it leaves your repository in an unknown state, which then requires careful gymastics to get out of.
Details
To work out what was responsible for emacs starting git processes I traced
call-process
invocations with,This revealed that
vc
'sauto-revert-handle
hook is the culprit,The text was updated successfully, but these errors were encountered: