-
Notifications
You must be signed in to change notification settings - Fork 291
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
streampager: allow running Streampager without reading its config files #1011
Conversation
Hi @ilyagr! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.) |
@ilyagr has updated the pull request. You must reimport the pull request before landing. |
Currently, there is no way for a calling program (like `sl` or `jj`) to start streampager without it trying to read `$CONFIG/streampager/streampager.toml` and the environment variables `SP_INTERFACE_MODE`, `SP_SCROLL_PAST_EOF`, and `SP_READ_AHEAD_LINES`. This is undesireable if we'd like to control Streampager's behavior fully from `jj` config (or `sl` config). Sapling currently overrides the most important Streampager config from its own config anyway. I'd like there to be a way to invoke Streampager with a given config. I carefully implemented it so that no changes to Sapling are required, though I think it'd also benefit from using the API I introduce here (and the old UI could be deprecated). Another, less invasive, possibility would be to simply make `Pager::config` public. However, this would mean that Streampager would uselessly read `$CONFIG/streampager/streampager.toml` even if the config is later fully overriden by `jj`. As an aside, the docs for the config from https://github.com/markbt/streampager#example-configuration do not seem to be fully correct, setting `interface_mode = "delayed"` as described there did not work for me. However, I'd rather not use that configuration method at all for my purposes with `jj`. Cc: jj-vcs/jj#4203 (comment), @yuja. As ever, thanks for making it convenient for us to use Streampager in `jj`! :)
@ilyagr has updated the pull request. You must reimport the pull request before landing. |
This pull request has been merged in 26edb15. |
Thank you very much! |
This could be considered as a bug report/feature request instead of a PR.
Currently, there is no way for a calling program (like
sl
orjj
) to start streampager without it trying to read$CONFIG/streampager/streampager.toml
and the environment variablesSP_INTERFACE_MODE
,SP_SCROLL_PAST_EOF
, andSP_READ_AHEAD_LINES
. This is undesireable if we'd like to control Streampager's behavior fully fromjj
config (orsl
config). Sapling currently overrides the most important Streampager config from its own config anyway.I'd like there to be a way to invoke Streampager with a given config. I carefully implemented it so that no changes to Sapling are required, though I think it'd also benefit from using the API I introduce here (and the old UI could be deprecated).
If there's a better way to achieve that than my approach here, I'd be happy to do that. Another, less invasive, possibility would be to simply make
Pager::config
public. However, this would mean that Streampager would uselessly read$CONFIG/streampager/streampager.toml
even if the config is later fully overriden byjj
.As an aside, the docs for the config from
https://github.com/markbt/streampager#example-configuration do not seem to be fully correct, setting
interface_mode = "delayed"
as described there did not work for me. However, I'd rather not use that configuration method at all for my purposes withjj
.Cc: jj-vcs/jj#4203 (comment), @yuja.
As ever, thanks for making it convenient for us to use Streampager in
jj
! :)