-
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
Enabling line-numbers breaks -/+ prefix stripping and staging individual hunks #13
Comments
Yes, there's a little bit of a mess here that needs sorting out. TL;DR: Here's the situation:
|
Actually, I think there's a better solution involving using delta "features". Try setting your (setq magit-delta-delta-args
'("--24-bit-color" "always"
"--features" "magit-delta"
"--color-only")) Then magit-delta will not use the [delta "magit-delta"]
whitespace-error-style = green reverse # or whatever |
@dandavison I have this config and [delta]
line-numbers = true
[delta "magit-delta]
line-numbers = false |
Hi @wyuenho, instead of setting the [delta]
features = line-numbers
[delta "magit-delta"]
line-numbers = false I just tested this and it seemed to fix it. I'm not claiming this is obvious! I definitely admit that delta config when using all the various possibilities has some subtleties and complexity, but it is at least pretty configurable. There are probably improvements to be made to make it more consistent. (There's a missing closing |
Does that mean I can only really have one set of config? |
No, pretty much anything is achievable I think -- I'd be happy to try to provide a config implementing any requested behavior. The config I posted above results in For the adventurous, a feature can have its own feature list, thus yielding a tree of sets of key-value pairs, in which any conflicts are resolved according to a tree traversal order which should hopefully be intuitive but is documented in the code (here and here). |
Your config isn't equivalent to mine. I don't want the main config to reference to I don't understand what's happening here. What's the relationship between |
Does this help? [delta]
# settings here will always be applied unless the user supplies --no-gitconfig on the command line
# These settings will override delta's defaults
[delta "my-feature"]
# This is just a named collection of key-value pairs.
# It has no effect at all unless the user has added "my-feature" to their "features" list.
# They could do that either
# (a) on the command line via `--features`, or
# (b) in the main `[delta]` section via `features = my-feature some-other-feature`
# (c) by setting the env var: `DELTA_FEATURES="my-feature some-other-feature"`
That's right, that's how it works. The |
The crux of the matter is, the same key in a feature section does not override the main section, because anything in the main section always applies, that's why line numbers are still showing up in my config when invoking |
Ah I'm sorry, I should have linked this issue: dandavison/delta#446
I think that's a bug specific to |
So my suggestion [delta]
features = line-numbers
[delta "magit-delta"]
line-numbers = false is a workaround for that bug. What you did definitely should have worked. |
When git is invoked as `git -c aaa.bbb=ccc -c ddd.eee=fff` then git sets the env var GIT_CONFIG_PARAMETERS containing the changed config entries, so that child processes can honor them. libgit2 doesn't yet honor the env var: see libgit2/libgit2#3854. Fixes #493 Fixes #307 Ref dandavison/magit-delta#13
When git is invoked as `git -c aaa.bbb=ccc -c ddd.eee=fff` then git sets the env var GIT_CONFIG_PARAMETERS containing the changed config entries, so that child processes can honor them. libgit2 doesn't yet honor the env var: see libgit2/libgit2#3854. Fixes #493 Fixes #307 Ref dandavison/magit-delta#13
When git is invoked as `git -c aaa.bbb=ccc -c ddd.eee=fff` then git sets the env var GIT_CONFIG_PARAMETERS containing the changed config entries, so that child processes can honor them. libgit2 doesn't yet honor the env var: see libgit2/libgit2#3854. Fixes #493 Fixes #307 Ref dandavison/magit-delta#13
When git is invoked as `git -c aaa.bbb=ccc -c ddd.eee=fff` then git sets the env var GIT_CONFIG_PARAMETERS containing the changed config entries, so that child processes can honor them. libgit2 doesn't yet honor the env var: see libgit2/libgit2#3854. Fixes #493 Fixes #307 Ref dandavison/magit-delta#13
dandavison/magit-delta#13 using various features like line numbers etc causes issues with magit. There are work-arounds, but it's not worth it for me because I really mostly use magit to view diffs instead of `git diff` so I'm Ok with default delta settings. For some reason magit needs to be refreshed when toggling the magit-delta mode on or off. So I added a function to do both. The magit-delta diff doesn't show the + / - signs which is sometimes useful when copy pasting the diff.
Sorry for jumping in. I arrived here because I searched for the |
@dandavison The suggestion in #13 (comment) does not work for me. I started using Diffs polluting the magit statusDiffs show/hide using
|
Quick update! It looks like this config works and makes both terminal-side and magit-side delta invocation happy. # In .gitconfig
[delta]
# https://github.com/dandavison/magit-delta/issues/13
# line-numbers = true # Don't do this.. messes up diffs in magit
#
side-by-side = true # Display a side-by-side diff view instead of the traditional view
Again, this would work only for folks who like to enable side-by-side. |
Document a workaround for the issue seen in dandavison/magit-delta#13.
Document a workaround for the issue seen in dandavison/magit-delta#13.
Document a workaround for the issue seen in dandavison/magit-delta#13.
dandavison/magit-delta#13 using various features like line numbers etc causes issues with magit. There are work-arounds, but it's not worth it for me because I really mostly use magit to view diffs instead of `git diff` so I'm Ok with default delta settings. For some reason magit needs to be refreshed when toggling the magit-delta mode on or off. So I added a function to do both. The magit-delta diff doesn't show the + / - signs which is sometimes useful when copy pasting the diff.
Will disable line mubers See dandavison/magit-delta#13
Using @dandavison's suggestion worked. 👍 But I could only assign At one point, I had read about the relationship between Thank you, @dandavison. |
Hey! I'm relatively new to emacs and found this package (and delta itself). Thanks for all your work, it looks amazing! 🤩
However, it looks like enabling the
line-numbers
feature indelta
breaks various functionality inmagit-delta
:+
and-
prefixes aren't stripped anymoreScreenshot:
This is on Archlinux, with emacs 27.1, Doom v2.0.9. I haven't found out what magit-delta version I'm running - Doom Emacs uses straight, so
pkg-info-package-version
doesn't know about magit-delta, andstraight-freeze-version
somehow errors out. Happy to provide more information if you tell me how to get it 🙂The text was updated successfully, but these errors were encountered: