-
Notifications
You must be signed in to change notification settings - Fork 406
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: Create a revset for checkout history #2871
Comments
Perhaps, this can be achieved by some revset to resolve |
Ah, I'd assumed that it does have deterministic order because of the existence of Unfortunately, since it isn't deterministic order, I don't think
Thus, I believe in this scenario it would evaluate to The only way I can think of to do it is to construct something like That being said, that operation would only work for one step back, and would fail for if you wanted to go |
If it simplifies things, I wouldn't mind if we added a specialized way of finding where @ pointed N steps back in the operation log. I suppose we may want two versions of that: one which considers every operation where @ pointed to a new commit, and one which considers only operations where @ pointed to a new change id. |
Inspired by this idea and Martin's idea, another feature we might want is a For example, There's a chance that (with some further development) we might be able to replace (I went back and forth on whether to file as a separate FR, I probably will if this idea gets traction). P.S. @yuja, thanks for digging up that old FR of mine! I forgot I already filed an issue for that. |
Implementation-wise, it'll be easier and is the only way to preserve the op log order.
Yep, if we had |
I think it's a good idea to allow (To be clear, I don't think any of this should replace Matt's original request, it's just a related idea). |
Is your feature request related to a problem? Please describe.
I'd like an easy way to reference "the change I previously had checked out".
Often, I'm working on some piece of PR
foo
, then I get a review on a PRbar
requiring an edit. In that case, what I want to do is:jj edit bar
jj edit prev
Describe the solution you'd like
I'd was thinking that two revset functions could be combined to do what I want here:
checkout_order([x=all()])
sorts x by the time the change ID was last checked out.slice(x, index[, size=1])
returns a slice of sizesize
starting atindex
.For example,
checkout_order([foo, bar, baz])
would start as[foo, bar]
(assuming baz was never checked out). Then after I checkoutbar
it'd instead return[bar, foo]
. I could then writefirst(checkout_order(~@))
to reference the previously checked out commit.For simplicities sake,
first(x[, n=1])
could be an alias toslice(x, 0, n)
.Describe alternatives you've considered
I've currently added
'prev' = 'latest(~@)'
to myconfig.toml
. However, if bar has children, then when you edit bar, their timestamps get updated, and you end up checking outheads(bar)
instead offoo
.I could obviously do
latest(~@::)
instead, but this one breaks iffoo
is a descendant ofbar
.The text was updated successfully, but these errors were encountered: