-
Notifications
You must be signed in to change notification settings - Fork 387
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
config: add --when.commands
scope
#5311
Conversation
Unsure how to update Also unsure if / where there are tests for pagers. I was unable to find any on a cursory glance. |
I think it's better to not overuse [ui]
paginate = "auto" # default
pager = "..." # default
[<table-for-per-command-pager-options>]
status.paginate = "never"
diff.pager = ["delta", "..."]
# or generic per-command table like this?
[commands.status]
ui.paginate = "never"
# or extend the conditional table?
[[--scope]]
--when.commands = ["status"]
ui.paginate = "never"
I think "file show" and "file list" are quite different, and the user might want to enable pager only for one of them. |
I'm intrigued by extending the The rule for Currently, |
or
|
Just saw this, nice! 🎉 FYI, I'm planning to add config for the built-in pager. My original thought was to simply create a |
nit: might be better to include "streampager" in the key (e.g.
The current idea is to extend the scoped table, so any parameters (except for |
I went back and forth on this. I went into the direction of making the options more generic, see #5415 . Your suggestion might still be better, I'm not sure; it's easy to change. If we go with that, perhaps
That sounds great! |
f50ef2c
to
76b1269
Compare
--when.commands
scope
76b1269
to
dedbc47
Compare
Completely changed the implementation, as reflected in the title. Now implements Also changed how config resolution works --- a condition can either be "resolved true", "resolved false", or "unknown". If any field is "unknown", the entire expression is unknown, and kept around. If any field is "resolved false", the entire expression is false, and discarded. Otherwise, added to current config. This means that if a config layer still contains a |
Do we really need this? As I said, config layers are resolved multiple times in |
... oooh, the |
dedbc47
to
6e9ec50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG (except for prefix match issue), thanks.
Closes #5217 Motivating use case: [[--scope]] --when.command = ["log"] [--scope.ui] pager = "less" This adds a new (optional) field to `--when` config conditions, to inspect the current command. `--when.commands` is a list of space-separated values that matches a space-separated command. To be specific: --when.command = ["file"] # matches `jj file show`, `jj file list`, etc --when.command = ["file show"] # matches `jj file show`, but *NOT* `jj file list` --when.command = ["file", "log"] # matches `jj file` *OR* `jj log` (or subcommand of either) When both `--when.commands` and `--when.repositories` are set, the intersection is used.
6e9ec50
to
5e045c0
Compare
I just noticed that the documentation has not been updated. Are you able to fix that, @bryceberger? |
The prerelease docs have some information. I'm not sure whether something is missing in there as well. |
No, that looks good. Sorry, I don't know why I went to the 0.25 docs. |
Closes #5217
Adds a new config scope resolution
--when.commands
. This is a list of space-separated commands:Checklist
If applicable:
CHANGELOG.md