-
Notifications
You must be signed in to change notification settings - Fork 319
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 functions for traversing the obslog #4129
Comments
I think I prefer There’s also the subtle difference between “this change ID at the previous op log version” and “this change ID at the previous obslog version” to consider. |
That's fair. I considered
This is also related to #1283. Maybe we'll want to support both in the future. The obslog seems simpler and more useful to me, but both are interesting |
Mercurial calls obslog-based resolution as |
Copying from #4097, I think obsparents, obschildren, obsancestors, and obsdescendants are relatively clear. This also allows for A related option would be to have |
Maybe
Or |
I would personally like something fairly short for the UX of the |
Maybe the new names should consider #3592 whenever we get around that.
I do like this idea though.
I don't think this should matter for the name bikeshed, as you always can add aliases. |
This is useful when you accidentally put some changes in the wrong commit. In the future, we could add some shortcuts for common uses. For example, we could define `current(X)` to be the current revision with the same change id as `X` (which would usually be a hidden commit) and have a shortcut for `jj split --from X -r current(X)` (only valid if `current(X)` is one commit). Or, we could have a similar operation for `obscurrent(X)`, defined as `obsheads(obsdescendants(X))` , based on the `jj obslog` graph (see also martinvonz#4129 for a more focused discussion about implementing such operation). However, let's have the basic operation first. It should be useful with the default value of `-r @`.
It'll be nice if we can filter obslog by diffs from the predecessor.
In revset, it might be expressed as |
Problem
Revsets are very cool. They provide a way to select a set of changes, without having to run
jj log
and manually copy the change IDs. Unfortunately, they only provide functions for moving between the most recent commits that changes point to. To select a previous version of a change, the user must first open the obslog, and then copy the commit ID for the version they're after.Solution
Introduce a set of functions for traversing the obslog. Much like
parents(x)
gives the parent change(s) of changex
that can be found withjj log -r ..x
,previously(x)
would give the parent commit(s) of the changex
that could be found withjj obslog -r x
.I'm proposing this set of functions where
previously
is the most useful and simple.Operators would also be really nice to have, especially in cases like
previously(previously(x))
but I'm not sure what symbol would be best.Use cases
Verbatim "ours" rebase/merge #1027
I initially wanted this feature to carry out verbatim rebases. This is based on an idea from @ilyagr.
Unlike adding a
--verbatim
flag torebase
, this also allows restoring into a child ofa
so that the conflict resolution can be viewed before squashing intoa
.Note that this is only equivalent to one type of git "ours" merge strategy. There are two subtly different types.
Restoring from a previous snapshot
Take this example
Footnotes
oldest
doesn't exist but should be too hard to add since we havelatest
↩The text was updated successfully, but these errors were encountered: