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
Magit rebase todo keybinding not working from normal mode #15089
Comments
I'm also facing the same problem but seeing how there hasn't been a commit editing any of this functionality on Spacemacs, it's probably an issue that arose somewhere upstream. One thing I've identified, however, is that it seems that any time we go into an interactive rebase, the mode is |
@muhifauzan Can you try updating your packages to see if getting the latest |
I have the same problem, on master, and with all packages updated |
I can confirm this bug. When In either case, in normal-state the expected key bindings doesn't work. If you also have
I'm investigating this. |
This may not be present if you don't have
https://github.com/magit/magit/blob/348d9b98614c824be3e2f05eef5ab91d67f6695e/lisp/git-rebase.el#L152 This is the default binding. |
Similarly, if you've both So for example,
|
In the said buffer, evaluate Thus the bindings are correctly defined, but just overriden.
The proposed workaround is to remap the conflicted bindings in any minor modes (especially evil-STATE-mode-map). |
Try (if (featurep 'helm-ls-git)
(cl-loop with prefix = "helm-ls-git-rebase-"
for (key . action) in helm-ls-git-rebase-actions
for def = (intern (concat prefix action))
nconc (list key def) into bindings
finally do (apply 'evil-define-key*
'normal helm-ls-git-rebase-todo-mode-map
bindings))
(let ((bindings '("p" git-rebase-pick
"r" git-rebase-reword
"e" git-rebase-edit
"s" git-rebase-squash
"f" git-rebase-fixup
"x" git-rebase-exec
"d" git-rebase-drop)))
(apply 'evil-define-key* 'normal git-rebase-mode-map
bindings))) |
I managed to suppress the issue by forcing Spacemacs to use a local copy of
With that, I no longer faced the bug even on the latest commit of the package and everything works fine again. Removing this and allowing the package to install through Melpa brought the issue back. |
@arifer612 I suspect renaming git layer to aaagit fixes this... |
Alphabetical? I thought layers are loaded in the order they were listed in the dotfile. There's layer shadowing which makes use of that order if I remember correctly. |
@arifer612 spacemacs/core/core-configuration-layer.el Line 1090 in 497c767
|
Wow it indeed is the case! I'll have to give it a closer look when I get back. |
I just thought I'd mention that I posted about this on Reddit almost 2 weeks ago. At the time I didn't find any ticket here and I thought I might be alone in seeing this: https://www.reddit.com/r/spacemacs/comments/q0eqcd/how_to_get_my_magit_keybindings_back_mode/ I can add that I just updated packages and the "undesired behaviour" remains. |
@arifer612 sorry for late reply. Was off for two weeks. I have tried, but still the same result. I'm currently using your workaround #15089 (comment). It works for now. |
I've been working around this issue by just running This restores all the functionality in that buffer that I'm used to having. |
The workaround is all right, but it'd be really nice to have a proper fix. It looked like you were on to something @lebensterben , #15089 (comment), I'm just not sure where to put that to try it out. Would it work to put into the magit layer for now? |
user-config optionally you can wrap it in a hook function to be evaluated after mentioned package is loaded. |
@lebensterben Thanks! Still, it would be nice to have it fixed in the magit layer at some point. |
From this comment
Another workaround is to just exclude (defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; ...
;; A list of packages that will not be installed and loaded.
dotspacemacs-excluded-packages '(helm-ls-git)
;; ...
)) It's a rather crude workaround in need of a proper fix, but if you have no use for |
This issue also affects interactive rebase from the command line ( |
As far as workarounds go, I came up with (setq auto-mode-alist (delete '("/git-rebase-todo$" . helm-ls-git-rebase-todo-mode) auto-mode-alist)) in user-config |
I think that delete modifies the list it is operating on, so I don't think you need the setq right? This seems like a better workaround than my manual workaround 👍 |
you have to use setq with delete delq del etc |
Confirming @tko workaround works great! |
I think there is a typo in the configuration for the (setq helm-packages
...
(helm-ls-git :require git)
... where the I suspect that the author of the commit that added support for Correcting |
@dankessler you're right. A quick PR is welcomed. (Away from computer now) |
Sure, I'll submit one now. I just want to be clear that this will effectively nerf |
helm-ls-git is specified as a package belonging to the helm layer, but it's declared with the (non-existent) keyword :require, which should likely be :requires. Changing it to :requires means that helm-ls-git will be installed only if the git *package* is installed. It seems possible the original author's intent was to install helm-ls-git only if the git *layer* was installed, but it's hard to know for sure. As far as I know, no current spacemacs layers install the git package, so fixing this typo will effectively remove helm-ls-git except for cases where the git package is somehow installed (either explicitly by the user, or through a private layer, etc). As of writing, helm-ls-git is currently interfering with some git-rebase keymaps (see syl20bnr#15089 for discussion), so fixing this typo *should* fix those issues for most users, although it'll fix it essentially by nerfing helm-ls-git
@dankessler But still a bug is a bug so let's fix it since it's discovered. |
I've been following along, and I think I understand what is going on. Apologies in advance if we've already figured this out, but I wanted to summarize my understanding before proposing a way forward. The issue is that when both Specifically, Until about September 2021, there was no such Personally, I imagine that most of us in this issue prefer the old behavior. To fix this, I suggest we add a user-configurable variable to the If
If
The "eval-after-load" approach seems messy, but the most reliable (i.e., it will work even if people blacklist certain packages). PS: h/t to @tko for suggesting modifying |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
This issue still matters. |
Still an open bug I will make a fix |
@smile13241324, thank you. |
@smile13241324, that commit appears to have made no difference. Still, whenever I do an interactive rebase I need to do |
Strange, I'll have another look |
@JDawson-Camlin can you post your system details? I am especially interested in the emacs version and layers you are using. |
(csv
(elfeed :variables elfeed-feeds
'(("https://github.com/psf/black/releases.atom" Black)
("https://github.com/magit/forge/releases.atom" Forge)
("https://github.com/magit/magit/releases.atom" Magit)
("https://github.com/networkx/networkx/releases.atom" NetworkX)
("https://github.com/python-lsp/python-lsp-server/releases.atom" python-lsp-server)
("https://github.com/scipy/scipy/releases.atom" SciPy)
("https://github.com/tridactyl/tridactyl/tags.atom" Tridactyl)))
pdf
(python :variables lsp-pylsp-plugins-rope-autoimport-enabled t lsp-pylsp-plugins-ruff-enabled t lsp-pylsp-plugins-ruff-unsafe-fixes t python-fill-column 72 python-fill-docstring-style 'pep-257-nn python-format-on-save t python-formatter 'black python-sort-imports-on-save t python-test-runner 'pytest)
rust semantic-web better-defaults emacs-lisp git helm lsp multiple-cursors treemacs)
|
I can reproduce the issue on a fresh clone of Spacemacs. Executing
After debugging around, I found that there are a few reasons why this is happening. Reason 1The workaround here leaving Detailed descriptionI verified this by wrapping around it with simple diff
A fixThis can be fixed by Patch for Reason 1
Documentation for `delete`
Applying the wrapped
Reason 2Anything that triggers Detailed descriptionAfter applying the fix above, everything works fine until I execute diff
A fixSince the issue surfaces again after Patch for Reason 2
Once again, the ConclusionThe problems seem to firstly, lie in the fact that EnvironmentThese are my system settings that I used to test on. Environment
(emacs-lisp git helm multiple-cursors treemacs)
|
More details can be found in syl20bnr#15089 (comment) Fixes syl20bnr#15089
Thanks for the detailed analysis @arifer612, would you have time to do a PR? |
No worries, I've already made the changes in my fork, so sure, not a problem. |
* fix: helm-ls-git overriding git-rebase-todo mode More details can be found in #15089 (comment) Fixes #15089 * refactor: use helm-ls-git instead of obsolete helm-ls-git-ls helm-ls-git-ls has been obsolete since helm version 1.9.2. Refer to emacs-helm/helm-ls-git@93b8692.
Confirming #16373 fixed the issue. Thanks @smile13241324! |
Description
git-rebase-todo
default keybinding not workingReproduction guide 🪲
SPC g s
l l
r i
Observed behaviour: 👀 💔
Usual
git-rebase-todo
buffer keybinding not working fromnormal
mode. For example, picking commit, dropping commit, moving commit, etc. The keybinding somehow triggered frominsert
mode instead thus breaking theinsert
mode because the key input was treated as commands instead of regular input.Expected behaviour: ❤️ 😄
Usual
git-rebase-todo
buffer keybinding working fromnormal
mode.System Info 💻
Backtrace 🐾
The text was updated successfully, but these errors were encountered: