-
Notifications
You must be signed in to change notification settings - Fork 391
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
🐛 Can't disable line numbering from command line #307
Comments
Hi @HaleTom, thanks for this. I agree it would be nice if this were more convenient. I think the best that's available right now is:
A couple of tangential thoughts: Sometimes I wonder if it might have been better not to use boolean flags at all in delta and only use flags with explicit values, especially seeing as delta is mostly not used directly at the command line. However, I don't think there's a path there that retains backwards compatibility. Is adding |
Ref clap-rs/clap#815 ("Add support for automatic negation flags") |
The current plan for addressing this is #340 (comment) (and see #446). |
@HaleTom is the following a workaround for you? [delta]
features = line-numbers
[delta "no-line-numbers"]
line-numbers = false Now by default delta will have |
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
In the master branch we can now do So I think that's the most convenient way to do it for the case of using delta with git. It should also be possible to disable it on the delta command line somehow, but perhaps that's less of a priority since we can do it conveniently in the git case, and we have the features workaround #307 (comment) otherwise. |
@dandavison I'm using your magit plugin and want it to display line numbers when called from command line git but not when called from magit. |
Hi @Atemu, two thoughts:
(add-to-list 'magit-delta-delta-args "--no-gitconfig")
(add-to-list 'magit-delta-delta-args "--light")
[delta]
features = not-magit-delta
[delta "not-magit-delta"]
line-numbers = true
[delta "magit-delta"]
line-numbers = false (setq magit-delta-delta-args (append magit-delta-delta-args '("--features" "magit-delta"))) |
This doesn't help with disabling something set in git config, but in case anyone comes across this issue searching for how to conveniently enable something like line-numbers or side-by-side, then IMO the best way is the on:
off:
|
Using Honestly, I don't see why |
If I run:
I see line numbers.
How do I disable line numbers from the command line?
I tried
--no-line-numbers
, but no joy. It would be great to be able to disable any boolean with--no-*
, to override something that had been previously enabled (eg by a script or bash alias)The text was updated successfully, but these errors were encountered: