-
Notifications
You must be signed in to change notification settings - Fork 346
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: Ability to specify tree for first commit of jj split
#4179
Comments
Funny you should say that. PTAL #4097. It seems to me that is exactly me predicting your suggestion, but let me know if there's a difference I missed from not reading carefully. Now I know there are 3 people who want it :) Update: Thanks for examples 2 and 3, I haven't considered them before. To clarify Example 2 a bit, I presume you are suggesting doing |
Revisiting this request - I'm still not too certain whether this workflow is better suited to a Following #3772 (comment), I could possibly foresee something like Example 2 and Example 3 are definitely more suited for a |
As discussed in #4097 (comment), an alternative option I like is One wrinkle is that it might actually be called |
Is your feature request related to a problem? Please describe.
Example 1: A user is working on a change...
...but they forgot to
jj new
and accidentally put their changes into@
!The user wants to get to the following log:
Example 2: A user wants to split a change...
...but it requires modifications are too hard to make in a diff editor, or they want to make some modifications and run some tests on those changes.
The user creates a new change on top, undoing some of their changes to get to their desired state:
The user wants to get to the following log:
Example 3: Same as example 2, but instead of creating a new change on top, the user duplicates
z
:Describe the solution you'd like
An argument for
jj split
which, similar tojj restore --from
, allows users to specify a revision to "restore the tree from" in the first commit.Example 1 becomes
jj split -r z --restore_from old_commit_id
. Example 2 becomesjj split -r z --restore_from y
. Example 3 becomesjj split -r z --restore_from y
(the same as Example 2).Describe alternatives you've considered
rebase
which rebases trees, not changes. This does not work for example 1, and - in my opinion - this process is intuitively more of a "split" than a "rebase".Additional context
Example 2 was briefly discussed on Discord. Currently, this involves either
jj backout -r y && jj squash -r y
, or usingjj restore --from
with other commands.The text was updated successfully, but these errors were encountered: