Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe provide an alternative to VC's mode-line information #2687

Closed
blaenk opened this issue Jun 8, 2016 · 3 comments
Closed

Maybe provide an alternative to VC's mode-line information #2687

blaenk opened this issue Jun 8, 2016 · 3 comments
Labels
area: emacs enhancement New feature or request wont add This feature will not be worked on
Milestone

Comments

@blaenk
Copy link
Contributor

blaenk commented Jun 8, 2016

My mode-line shows the vc-mode information. When I add a new file that's currently untracked, then I stage it and commit it, the mode-line for that buffer remains as if it's untracked. I have to go to the buffer and do M-x revert-buffer I guess so that it re-triggers visit-file which I believe is when vc-mode is re-run to see if the file is tracked and if so show the information. Of course this is a hassle to do and sometimes misleading because it leads me to believe that I forgot to stage the file.

I was under the impression that magit's auto-reverting would do this for me automatically, a natural consequence being that it would update/show the vc-mode information. However this doesn't seem to be happening, so I believe I'm misunderstanding something.

With emacs 25 onward however, it's possible to refresh the vc-mode state/information without having to revert-buffer. The new M-x vc-refresh-state does this and indeed works perfectly fine and very quickly. I'm wondering if we can have magit run this automatically for buffers that would otherwise be reverted because they were affected by a recent change via magit. Or if you're against that, if we could perhaps add this to some hook so that it would run for affected files, which I believe will have the same effect of updating the information for previously-untracked files.

@tarsius
Copy link
Member

tarsius commented Jun 9, 2016

Actually this can be rather slow when there are many buffers and or files. For now please see https://magit.vc/manual/magit/The-mode_002dline-information-isn_0027t-always-up_002dto_002ddate.html and https://github.com/magit/magit/wiki/magit-update-uncommitted-buffer-hook. The latter explains how you can get this by copying a bit of code to your init file.

But this keeps coming up again and again, so I will look into this again eventually.

@tarsius tarsius added the enhancement New feature or request label Jun 9, 2016
@blaenk
Copy link
Contributor Author

blaenk commented Jun 10, 2016

Yeah sorry for not noticing that tarsius! I really appreciate the wealth of documentation you've created for Magit. Magit was and continues to be by far largest reason for me switching to Emacs from Vim, and I was so excited about it that I read the manual for Magit from "cover to cover," so I hope you don't think your great documentation goes to waste, I just forgot that you had already covered this.

@tarsius tarsius added this to the 3.1.0 milestone Aug 5, 2016
@tarsius tarsius modified the milestone: 3.1.0 Feb 13, 2017
@tarsius tarsius changed the title vc-refresh-state on emacs 25 Maybe provide an alternative to VC's mode-line information Oct 8, 2017
@tarsius tarsius added this to the maybe milestone Mar 29, 2018
seagle0128 added a commit to seagle0128/doom-modeline that referenced this issue Sep 20, 2018
Workaround:
Revert the buffers manually.
(setq auto-revert-check-vc-info t) brings the same performance issue.

Refer to:
magit/magit#2687
https://magit.vc/manual/magit/The-mode_002dline-information-isn_0027t-always-up_002dto_002ddate.html
@tarsius tarsius added the wont add This feature will not be worked on label Nov 4, 2018
@tarsius
Copy link
Member

tarsius commented Nov 4, 2018

But this keeps coming up again and again, so I will look into this again eventually.

It doesn't do that anymore and I really don't want to implement it because I don't think it is useful and because it would be a lot of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: emacs enhancement New feature or request wont add This feature will not be worked on
Development

No branches or pull requests

2 participants