GNU bug report logs -
#21559
25.0.50; auto-revert-mode breaks git rebase
Previous Next
Reported by: Ben Gamari <ben <at> smart-cactus.org>
Date: Fri, 25 Sep 2015 14:31:02 UTC
Severity: normal
Found in version 25.0.50
Fixed in version 27.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
Message #65 received at 21559 <at> debbugs.gnu.org (full text, mbox):
On Sun, Feb 07 2016 at 11:55:07 AM, Ben Gamari <ben <at> smart-cactus.org> wrote:
> I've spoken with some folks in #git about this issue.
>
> * the index lock is held "because it needs to read the index and
> compare it to the worktree. If it doesn't take the index lock, other
> things could change either the index or the worktree underneath it,
> making git status lie (or even crash)"
Makes sense...
> * It sounds as though a patch refactoring `git rebase` such that it
> holds the index lock may be considered, although this is a
> non-trivial refactoring as `rebase` is currently a shell script
>
> * One option would be to check whether a rebase is in progress before
> auto-reverting. In pseudo-shell,
>
> if [ -e .git/rebase-apply ] || [ -e .git/rebase-merge ]; then
> do_not_call_git_status_because_we_are_rebasing;
> else
> auto_revert
> fi
>
> Unfortunately it sounds like this wouldn't do the right thing when a
> rebase pauses due to conflict (when you'd ideally want to
> auto-revert).
Yeah that would definitely be a problem. The other problem with this is
fix is that it wouldn't fix any other use case that locks the index,
like my repro earlier:
$ cd /path/to/emacs
$ ./src/emacs -Q lisp/*.el
[ M-x global-auto-revert-mode ]
$ for i in $(seq 30); do for f in lisp/*.el; do echo "; $i" >> $f; done; git commit -am "test $i"; done
There's no rebase there, so detecting a rebase to skip auto-revert
wouldn't help...
Hopefully we can get rid of the `git status' from the auto-revert path
altogether. It looks like the only place we do a `git status' is in
`vc-git-conflicted-files'. We call that from `vc-git-find-file-hook' to
see if we should start smerge. But I don't see how we get there from
auto-revert.
This bug report was last modified 6 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.