-
Notifications
You must be signed in to change notification settings - Fork 373
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: Add builtin_immutable_heads()
#4162
Comments
I'm taking a stab at this in #4195 and I have a few questions:
Thoughts? |
That seems fine to me. I think the |
Yes. This makes sense. Let me see how I can make that work. Thanks |
* Add `builtin_immutable_heads()` in the `revsets.toml`. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Warn if user redefines `builtin_immutable_heads()`, `mutable()` or `immutable()`. * Update module constant in revset_util.rs from BUILTIN_IMMUTABLE_HEADS to USER_IMMUTABLE_HEADS to avoid confusion since it points at `immutable_heads()` **and** we now have a revset-alias literally named `builtin_immutable_heads()`. * Add unittest * Update CHANGELOG * Update documentation. Fixes: #4162
* Add `builtin_immutable_heads()` in the `revsets.toml`. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Warn if user redefines `builtin_immutable_heads()`, `mutable()` or `immutable()`. * Update module constant in revset_util.rs from BUILTIN_IMMUTABLE_HEADS to USER_IMMUTABLE_HEADS to avoid confusion since it points at `immutable_heads()` **and** we now have a revset-alias literally named `builtin_immutable_heads()`. * Add unittest * Update CHANGELOG * Update documentation. Fixes: #4162
* Add `builtin_immutable_heads()` in the `revsets.toml`. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Warn if user redefines `builtin_immutable_heads()`, `mutable()` or `immutable()`. * Update module constant in revset_util.rs from BUILTIN_IMMUTABLE_HEADS to USER_IMMUTABLE_HEADS to avoid confusion since it points at `immutable_heads()` **and** we now have a revset-alias literally named `builtin_immutable_heads()`. * Add unittest * Update CHANGELOG * Update documentation. Fixes: #4162
* Add `builtin_immutable_heads()` in the `revsets.toml`. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Warn if user redefines `builtin_immutable_heads()`, `mutable()` or `immutable()`. * Update module constant in revset_util.rs from BUILTIN_IMMUTABLE_HEADS to USER_IMMUTABLE_HEADS to avoid confusion since it points at `immutable_heads()` **and** we now have a revset-alias literally named `builtin_immutable_heads()`. * Add unittest * Update CHANGELOG * Update documentation. Fixes: #4162
* Add `builtin_immutable_heads()` in the `revsets.toml`. * Redefine `immutable_heads()` in terms of `builtin_immutable_heads()` * Warn if user redefines `builtin_immutable_heads()`, `mutable()` or `immutable()`. * Update module constant in revset_util.rs from BUILTIN_IMMUTABLE_HEADS to USER_IMMUTABLE_HEADS to avoid confusion since it points at `immutable_heads()` **and** we now have a revset-alias literally named `builtin_immutable_heads()`. * Add unittest * Update CHANGELOG * Update documentation. Fixes: #4162
This is slightly outside the scope of this FR, but I wonder whether we also want want |
Possibly? but I suspect user |
I'm not sure that this is a valid argument against |
One other option might be to simplify the log revset so that it's easier to remember/understand. When I was first trying to configure the log, the [revsets]
log = "@ | trunk() | context(mutable())"
[revset-aliases]
"context(x)" = "ancestors(x, 2)" I think this is easier to remember, since it reads more like a sentence ("I want to see @, trunk, and also all mutable commits with context"). |
If many users can't leverage it, I think |
Is your feature request related to a problem? Please describe.
When redefining
immutable_heads()
, there is no way to include the default set. Since the default set occasionally changes, the user has to change their config to get the new settings.Describe the solution you'd like
Define the default set in
builtin_immutable_heads()
and redefineimmutable_heads()
like so:If a user overrides
immutable_heads()
and includesbuiltin_immutable_heads()
, updates to jj's default will automatically be used.If the user doesn't want to include the default set, they simply omit
builtin_immutable_heads()
. This means this change wouldn't adversely affect anyone until they opt-in by addingbuiltin_immutable_heads()
to their config.Describe alternatives you've considered
If we wanted the user to opt out of the default set rather than opting in, the definition could be like so:
The user could still opt out by defining
real_immutable_heads()
instead.However, I think this alternative is too opinionated, not backwards compatible, and harder to explain:
Versus:
Additional context
This was discussed in another pull request with @yuja, @scott2000, and @ilyagr.
The text was updated successfully, but these errors were encountered: