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

cli: ability to disable default configs #5538

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dpc
Copy link

@dpc dpc commented Jan 31, 2025

My motivation is mostly to address #5098 , but in a lot of software there's a flag to disable sourcing default configs, which is useful in a lot contexts.

A more granular (or just atlernative/better) approaches would require more design and debate, while this seems simple and immediately useful (at least to some).

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

Copy link

google-cla bot commented Jan 31, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

My motivation is mostly to address jj-vcs#5098 , but in a lot of
software there's a flag to disable sourcing default configs,
which is useful in a lot contexts.

A more granular (or just atlernative/better) approaches
would require more design and debate, while this seems
simple and immediately useful (at least to some).
@martinvonz
Copy link
Member

Thanks, but JJ_CONFIG= jj should already have this effect

@dpc dpc force-pushed the dpc/25-01-31-no-default-config-2 branch from bbdb7f4 to 33c1c16 Compare January 31, 2025 20:49
@dpc
Copy link
Author

dpc commented Jan 31, 2025

@martinvonz The JJ_CONFIG controls the user's config, no? While I'm trying to disable the default configs shipped with jj.

@martinvonz
Copy link
Member

Oh, I'm sorry. Interesting. We have a lot of code that depends on the default configs existing, so I think it's going to be more complicated to support than this PR's current state.

@dpc
Copy link
Author

dpc commented Jan 31, 2025

@martinvonz I just noticed. Oops.

As a first user who'd want this, I don't mind just adding all the required keys to my config, and thus being sure I am in full control.

Also (or/and), I could add unwrap_or_default() on most obvious ones.

Also (or/and) I could add JJ_CONFIG_NO_DEFAULT_COLORS.

And (or/and), some config toml could be considered "essential", and loaded even with JJ_NO_DEFAULT_CONFIG.

@dpc
Copy link
Author

dpc commented Jan 31, 2025

image

This seems to have no issues.

@dpc dpc force-pushed the dpc/25-01-31-no-default-config-2 branch from f595d73 to b5a4577 Compare January 31, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants