-
Notifications
You must be signed in to change notification settings - Fork 343
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: reorder
AKA histedit
command (better tools for reordering commits part 2)
#1531
Comments
reorder
AKA histedit
command, better tools for reordering commits part 2reorder
AKA histedit
command (better tools for reordering commits part 2)
+1 to start simple, but eventually I think it's worth supporting split if it's going to support fold, or something to conveniently solve the case when I have a stray line of changes in one commit I want to move down into a child. Another feature I'd love eventually: hint in the sequence editor if a reorder is going to cause merge conflicts. |
At the moment, I feel that
Ideally, this would be solvable by either |
Now, the plan is to not do #1530's |
An update on my personal feelings on this: I now think that we should implement Some of us are also excited about a GUI tool similar to Sapling's ISL, which might also make more sense than an interactive rebase. |
What is this were just a I can understand the desire for a TUI but I feel like I could be really efficient with a git-like editor UI. Maybe we could have room for both ( RE need for interactive support: For myself, this is about speed and confidence: I can just move things around and I'm done compared to getting the right IDs, writing the exact command needed, and wondering if I got the right things. For myself, I'd find a GUI taking me out of my flow. |
By "git-like" editor UI you mean the flat file UX? I wouldn't mind just having the file equivalent of I think a major advantage of a TUI "sequence editor" like the one Ilya linked is that it is much more viable to handle actual trees, not just single-head series. A lot of our commands generalize well over trees, and we often want to talk about them since they're so cheap to create, so I think this is desirable. For example, given the following tree with two heads:
What if you wanted to reorder " A thing with the format used by Another advantage of a "tree editor" like this in our model is that a TUI could show you the resulting speculative tree, including conflicts. For example, if I selected commit
where the I think using some kind of modal UX, Kakoune/Helix/Vim style inputs, would make this very fast and efficient. So, I think a flat-file editor UI like |
In terms of the implementation, this would follow
#1530#1188 (comment).A
jj reorder
command would be very similar tohg histedit
/git rebase --interactive
. Apart from reordering, it could also support squashes (both "roll" and "fold") and abandoning commits, just like the hg/git versions. I see no need for it to support splits/edits; it's simpler to edit or split commits one by one before or after reordering.Aside on names: I like the name
reorder
better thanhistedit
, even if we do support more than reordering, buthistedit
is also a fine name. The main downside is that we tend to use real English words for jj commands, and it would be nice to continue this tradition. However, there are already exceptions.Optional in first version: For merge commits, the
reorder
command could be more clever thanswap
.jj reorder rev
would demand that the intermediate commits (rev:@
) form a line and thatrev
itself is not a merge commit. Then, it makes sense to reorder merge commits in this line while preserving all but one parent of these merge commits.Other optional features:
jj reorder rev1 --to rev2
could be synonymous tojj reorder --from rev1 --to rev2
.jj reorder
without a revision specified could take either 10 last commits or find the first merge commit ancestor of @ and take the line up to it, not inclusive. The number 10 could be adjustable, e.g.jj reorder -n 20
could be legal.We could support a nice TUI interface. For git, there exist "sequence editors" (example) which we could support. We could also make one. (The one I linked to is GPL, but even if we have to make our own, that'd be easier than making a TUI diff editor)
The text was updated successfully, but these errors were encountered: