syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

[upstream] magit status diff view broken, status buffer not updating on changes #13216

Closed practicalli-johnny closed 4 years ago

practicalli-johnny commented 4 years ago

Description :octocat:

Upstream bug: magit / magit-section

Magit status shows a character based raw diff view, rather than the usual colorised display

Example screenshot:

The status buffer does not update the details when staging files, even though it does seem to stage them.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: The magit status displays the diff using the raw diff characters.

Untracked, Modified, Staged sections are not shown.

The magit status buffer does not update when staging a change. It is not possible to select specific lines to stage.

Expected behaviour: :heart: :smile: Magit status should show a visual diff, similar to the ediff buffer. There should also be Untracked, Modified, and Staged sections.

When staging a file, the status buffer updates to show the change in status.

System Info :computer:

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
practicalli-johnny commented 4 years ago

Temporary fix: Use magit from GitHub, using a commit from 16 days ago (last known version I knew worked)

Deleted all magit packages from the .emacs.d/elpa/emacs-version/develop/ directory Set this recipe in dotspacemacs-additional-packages in the .spacemacs file

(magit
  :location (recipe
                   :fetcher github
                   :repo "magit/magit"
                   :commit "4d6bc190b2334fa226035d13fcdfce3cca55d7be"))

Restarted Emacs a couple of times and the magit-diff works just fine.

I do get a warning on first reboot about magit version, I assume this is because it hasnt compiled in time Emacs has loaded or is loaded after something that depends on it.

duianto commented 4 years ago

The magit status buffer seems to be fine with my setups. On the latest develop branch with updated packages.

I also tried moving out the magit packages:

magit-20200126.1750
magit-gitflow-20170929.824
magit-popup-20200102.1811
magit-section-20200123.2235
magit-svn-20190821.1455

from the elpa/develop dir and restarted so that they were downloaded again.

It still looks as expected after:

The diff looks as expected:

VirtualBoxVM_2020-01-28_21-27-04

PopOS 19.10
#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 75cfd40d3)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(auto-completion command-log emacs-lisp git github helm markdown multiple-cursors
                 (org :variables org-agenda-files
                      '("~/org/notes.org"))
                 (shell :variables shell-default-height 30 shell-default-position 'bottom)
                 spell-checking syntax-checking treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2
Windows 1903
#### System Info :computer:
- OS: windows-nt
- Emacs: 26.3
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 75cfd40d3)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(autohotkey auto-completion colors command-log emacs-lisp git haskell helm imenu-list markdown multiple-cursors org python
            (shell :variables shell-default-shell 'eshell)
            spell-checking syntax-checking treemacs version-control)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS LCMS2
practicalli-johnny commented 4 years ago

Have you restarted Emacs after the magit-section installed? It was only causing the error after a restart.

It could also have been fixed upstream. I will check to see if it has the same behaviour.

practicalli-johnny commented 4 years ago

This issue is no longer affecting me. I would put this down to a faulty package download, however, it was affecting another person. It could have been a faulty upload or just the effects of the quantum nature of the universe :)

Thanks for checking. I will close this issue.

duianto commented 4 years ago

Thanks for including a screenshot. It's helpful to see what the issue looks like. That's what qizwiz also saw: https://gitter.im/syl20bnr/spacemacs?at=5e2f0acca420263e03ab9bb7

qizwiz said that it was related to dotspacemacs-whitespace-cleanup

ok, a bit more research.. I'm getting closer to making it reproducible. The problem only happens when dotspacemacs-whitespace-cleanup is set to 'changed

https://gitter.im/syl20bnr/spacemacs?at=5e2f4b791a1c2739e30e6333

I tried all four whitespace cleanup settings: 'all, 'changed, 'trailing and nil in both OS's, and restarted in between each change.

But I'm not seeing any issues.

You might be right, it could have been fixed upstream before my tests.

or just the effects of the quantum nature of the universe

😄

qizwiz commented 4 years ago

I still see the problem when dotspacemacs-whitespace-cleanup is set to 'changed only.

Screenshot from 2020-01-29 09-27-26

This is with the latest emacs compiled from source daily and the latest spacemacs downloaded and built from clean ~/.emacs.d/elpa/ daily.

The issue doesn't seem to be magit-section, per se, but the interaction between magit-section and ws-butler-mode

practicalli-johnny commented 4 years ago

@qizwiz it would be useful if you can try on Emacs 26.3 (latest sable version) to see if this is an issue with just the latest daily builds and not something else in your Spacemacs setup.

I never experienced the whiespace-cleanup issue myself on Emacs 26.3. I wasn't able to build Emacs successful on my Linux machine.

brunosmmm commented 4 years ago

I though of trying emacs 27 out due to the chatter about faster json parsing, and thus faster and in many cases now actually usable lsp, and hit the exact same patterns as shown by @qizwiz screenshots, however, it doesn't go away at all by changing whitespace options.

@jr0cket at least everything worked for me on 26.3 so it is definetely a >= 27.x issue. rolling magit back to an older commit also does not work.

qizwiz commented 4 years ago

I was able to fix it for myself by rolling back emacs as described in this comment: #https://github.com/hlissner/doom-emacs/issues/2470#issuecomment-584308719

Alternatively, you can use ws-butler from this repo: #https://github.com/hlissner/ws-butler (Unfortunately, I don't know how to change where the repo points to in spacemacs)