-
Notifications
You must be signed in to change notification settings - Fork 10
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
Seems to break staging by hunks #22
Comments
Hi @vermiculus, let's get to the bottom of this. Staging by hunks does work in general (is working for me; wasn't aware of others having problems before this). Can you post your |
I will check my personal computer when I get home, but I had just installed delta to try this out, so I don't think I have any config unless installation itself created it. My magit-delta configuration is only what you see in the the use-package form in the screenshot. |
|
@vermiculus would you be able to do a little experiment? I'm thinking, let's capture the args and input that git is receiving so we can see what is wrong with the patch. So instructions would be
Now stage a hunk in magit and look in
Could you post the args and patch that are written to that file when magit reports that the patch failed? |
Also, just to check -- is delta working correctly outside magit? Is it just staging individual hunks that is problematic, or are there any other problems when using magit-delta? |
To be fair, I haven't used Staging individual hunks was the only problem I noticed. |
I encountered this when I set |
@vermiculus this problem seems to be specific to your environment. What would be really helpful is if you could capture the patch that is being sent to git:
I think if we could see that, we'd see what is going wrong. I've put instructions for capturing the patch above: #22 (comment) |
I have the same situation, and have |
Hi @g5pw, that's right:
And then add the settings you do want in magit-delta using elisp (e.g. more But there are several other possibilities, if you don't like the potential duplication of settings in that solution. E.g. you could use features to define |
Thanks @dandavison, your profile suggestion resolved the issue! Still, it feels a bit like a workaround, maybe there could be a way to automatically disable line numbers when called from magit? |
Found this fix in g5pw/dotfiles@9fdbe2c referenced from dandavison/magit-delta#22
I did what @dandavison suggested:
So, in case it is useful for someone, here it is: ;; ~/.emacs.d/init.el
(use-package magit-delta
:hook (magit-mode . magit-delta-mode)
:config
(setq magit-delta-delta-args (append magit-delta-delta-args '("--features" "magit-delta")))) # ~/.config/git/config
[delta]
navigate = true # use n and N to move between diff sections
side-by-side = true
#
features = default magit-delta
[delta "default"]
line-numbers = true
[delta "magit-delta"]
line-numbers = false # ~/.bashrc
export DELTA_FEATURES=+default |
When I have magit-delta-mode enabled, I can't seem to stage individual hunks:
This seem related to #13 and #18, but I don't have line numbers enabled.
The text was updated successfully, but these errors were encountered: