Opening a directory or a subdirectory of some git repository in Dolphin often makes command-line git unusable in that directory, because Dolphin constantly re-creates the git lock for some reason. Removing the lock doesn't help — dolphin creates it again. Only navigating outside of the directory in Dolphin (or closing the directory completely) helps. Reproducible: Sometimes Steps to Reproduce: 1. open some git repository in Dolphin 2. LANG=C watch -n 0.1 ls -l --time-style=full-iso .git/index.lock 3. If you don't see .git/index.lock above, try navigating in that repo or opening a larger repo. Actual Results: I observe .git/index.lock being constantly created and updated. Expected Results: I expect no .git/index.lock created by file manager untill user manually performed some git operation with it.
Still reproducable on 17.12.1. To observe this, the git plugin should be enabled in Dolphin.
I can reproduce the generation of a lockfile but it gets destroyed instantly. After looking into the code of the plugin, I think the lockfile gets created while searching for the stati of the files, see: https://github.com/KDE/dolphin-plugins/blob/d69ced47023c52078854e96bcdfa6ec3675251ec/git/fileviewgitplugin.cpp#L176 The git status command generates a lockfile automatically. So in a way, by changing the folder you "manually" perform a git operation (unconsciously). git status is locking because it is caching the status in the repository. It cannot be disabled in git. We could try to use the workaround number 2 of https://stackoverflow.com/questions/27706108/git-do-not-create-index-lock-for-read-only-operations
(In reply to Nopeinger from comment #2) > I can reproduce the generation of a lockfile but it gets destroyed instantly. > > After looking into the code of the plugin, I think the lockfile gets created > while searching for the stati of the files, see: > https://github.com/KDE/dolphin-plugins/blob/ > d69ced47023c52078854e96bcdfa6ec3675251ec/git/fileviewgitplugin.cpp#L176 > > The git status command generates a lockfile automatically. > So in a way, by changing the folder you "manually" perform a git operation > (unconsciously). > > git status is locking because it is caching the status in the repository. > It cannot be disabled in git. > > We could try to use the workaround number 2 of > https://stackoverflow.com/questions/27706108/git-do-not-create-index-lock- > for-read-only-operations Nopeinger would you care to try your hand at a patch to Dolphin to not use a lock file while doing read-only operations?
A possibly relevant merge request was started @ https://invent.kde.org/sdk/dolphin-plugins/-/merge_requests/19
Git commit 31f46bf7b2cee0156bd57525b2f5e78d41578d7b by Elvis Angelaccio, on behalf of Sebastian Englbrecht. Committed on 31/10/2020 at 14:15. Pushed by elvisangelaccio into branch 'master'. Git status does not generate index.lock The git option (Note: not git status) --no-optional-locks prohibits the generation of the lockfile in read-only operation, thus not blocking other e.g. manually typed commands. https://bugs.kde.org/show_bug.cgi?id=363576 M +1 -1 git/fileviewgitplugin.cpp https://invent.kde.org/sdk/dolphin-plugins/commit/31f46bf7b2cee0156bd57525b2f5e78d41578d7b