Sometimes, though seemingly not in a consistent way, some modes that use version control information do not get updated correctly after
git commands are run (e.g.,
git-gutter-mode indicate uncommitted changes though those changes have already been committed, or
vc-mode-line will show the name of a branch that I am no longer on).
It seems to be different behaviors that trigger it, but two cases where I made note of what I did to trigger the behavior are:
- Doing a
git rebasefrom a terminal outside of emacs
- Creating and checking out a new branch through the
When this happens, it seems like
magit is always up to speed and displays the correct information, as does
git status from the command line of course. However, the mode-line and sometimes other packages like
diff-hl-mode are one branch change or one commit behind.
I hope this is enough information to give someone some idea as to what could be going on. What I would like to know specifically is:
What is causing this behavior? The symptoms as described here may be too vague at the moment, but I will try to add more details as I have them. My guess is that either a mode is not updating correctly when vc information changes, or a mode that is changing vc information is not letting other modes know in the right way - but I could be way off.
When this happens, how can I refresh version control information so that various modes that use the information will displays correctly? Restarting emacs has always worked, but it would be nice to not have to resort to that.