Skip to content
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

FR: Environment variables in templates/configs #5571

Open
algmyr opened this issue Feb 4, 2025 · 1 comment
Open

FR: Environment variables in templates/configs #5571

algmyr opened this issue Feb 4, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@algmyr
Copy link
Contributor

algmyr commented Feb 4, 2025

I've run into some cases where having configs conditional on env variables would be useful. Access in templates would give some of the powers I would like, but maybe a --when for env variables would be the more natural thing.

One example for a thing I'm playing around with:

Some terminals have fancy capabilities that will not work in other terminals, being able to adapt based on TERM would allow writing a config that works more generally.

Describe the solution you'd like

Provide access to lookup env variables in templates, and/or allow config scoped on env variable values.

Describe alternatives you've considered

Writing a jj wrapper or similar could accomplish the same thing, but it doesn't feel desirable.

@yuja
Copy link
Contributor

yuja commented Feb 4, 2025

and/or allow config scoped on env variable values.

Adding --when.environments = ["KEY=VALUE"] wouldn't be difficult, but we might need a proper expression language to express negative patterns, etc.

@yuja yuja added the enhancement New feature or request label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants