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

Breaking the trunk() alias doesn't warn immediatelly #4846

Closed
Necior opened this issue Nov 13, 2024 · 0 comments · Fixed by #4851
Closed

Breaking the trunk() alias doesn't warn immediatelly #4846

Necior opened this issue Nov 13, 2024 · 0 comments · Fixed by #4851

Comments

@Necior
Copy link

Necior commented Nov 13, 2024

Description

Renaming a Git remote might break the trunk() alias. The warning is printed on a subsequent command rather than on the one that broke the alias.

(Not sure if working-as-intended but it was confusing to me.)

Related: #4616.

Steps to Reproduce the Problem & Actual Behavior

$ jj git clone [email protected]:martinvonz/jj.git
$ cd jj
$ jj git remote rename origin upstream
$ jj status
Warning: Failed to resolve `revset-aliases.trunk()`: Revision "main@origin" doesn't exist
Hint: Use `jj config edit --repo` to adjust the `trunk()` alias.
The working copy is clean
Working copy : uxoupnzt feeefad9 (empty) (no description set)
Parent commit: kznzyvnl 1e527dd2 main | cargo: bump serde in the cargo-dependencies group

Expected Behavior

Ideally, renaming the remote would fix the trunk() alias and jj status would emit no warnings.

I presume that the trunk() alias might be arbitrarily complex in the general case. That would make an implementation of an automatic fix difficult. (And it's not obvious whether an automatic fix is desired in the first place.)

If this is the case, emitting the warning when breaking the alias (in this case: when executing jj git remote rename origin upstream) would be IMO more user friendly than the status quo.

As of right, now it's not obvious which command broke the alias. The first time I encountered this behavior, the warning was emitted while adding another remote -- that was confusing.

Specifications

  • Platform: Linux
  • Version: jj 0.23.0-7be4904982bf1819f1d5fc1e223d4b608c7830f6
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 a pull request may close this issue.

1 participant