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: revset function(s) to singularize revisions (maybe first(...) to start with) #1110

Closed
avamsi opened this issue Jan 23, 2023 · 2 comments
Closed

Comments

@avamsi
Copy link
Member

avamsi commented Jan 23, 2023

This could be useful with commands like rebase that only take a single revision -- for example,

$ jj rebase -b 'first(remote_branches("", origin).. ~ empty())' -d main
@yuja
Copy link
Contributor

yuja commented Jan 23, 2023

What do you expect to be the first with that revset?

I considered adding first() or limit() before, but rejected my idea because the order of revsets seemed to be implementation detail in jj, and the visible order could also be affected by #242.

It might be better to specify the sorting order explicitly (e.g. latest() to pick the first element in committer-timestamp order.)

@avamsi
Copy link
Member Author

avamsi commented Jan 23, 2023

Makes sense, first was just the first singularizing function I could think of 😅 -- latest(...) might be even better for the rebase workflow I was thinking of (more often than not, I would probably be okay with just rebasing the latest commit I'm working on, leaving any older ones untouched).

Also, I just realized, the rebase example in my first comment should probably be more like the one below (exclude main: so that the command is repeatable) --

$ jj rebase -b 'latest(remote_branches("", origin).. ~ (main: | empty()))' -d main

@yuja yuja closed this as completed in 0532301 Mar 25, 2023
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

No branches or pull requests

2 participants