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

revset: add remote function #5450

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

Grillo-0
Copy link
Contributor

This can be used to find the remote bookmark tracked by a revset.

It can be useful for diffing with the remote:
jj diff --from remote(@) --to @

Fixes: #4756

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

This can be used to find the remote bookmark tracked by a revset.

It can be useful for diffing with the remote:
`jj diff --from remote(@) --to @`

Fixes: jj-vcs#4756
Comment on lines +375 to +379
if let Self::CommitRef(commit_ref) = commit_ref.borrow() {
Some(Rc::new(Self::CommitRef(RevsetCommitRef::Remote {
commit_ref: Box::new(commit_ref.clone()),
remote_pattern,
})))
Copy link
Contributor

@yuja yuja Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, it's correct that we can't support full range of revset expressions at the name resolution stage, but this is a big limitation I didn't notice before. We'll probably want to do remote(@-) or something, but x- can't be evaluated here. I have no idea how we can solve this problem.

We might need a language selecting bookmarks. Related: #5307

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It would still be useful in that it allows you to create an alias that you can pass a specific bookmark name to, right?

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.

FR: jj diff --remote
3 participants