-
Notifications
You must be signed in to change notification settings - Fork 596
cli split: Add a config option controlling how bookmarks move during splits #5618
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, lgtm. I will leave the last call to Martin.
57aed5a
to
c92fa61
Compare
Makes sense; done. Thanks for taking a look :) |
b4ee730
to
603208b
Compare
dce749f
to
7936539
Compare
68280b0
to
a32eeba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'll leave it for a non-googler to approve (EDIT: ah, you already have approval)
a32eeba
to
212dde7
Compare
212dde7
to
d242f08
Compare
We are planning to add a config option that controls how bookmarks and change ids move based on feedback in #5618. I think the tests will be more readable after the config option is added if we move the bookmark testing to its own test.
648b696
to
62f2caf
Compare
62f2caf
to
183a478
Compare
183a478
to
6f4f1ec
Compare
6f4f1ec
to
bc25d6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still looks great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had these two draft comments that I meant to send. (But don't let that change your decision about the warning.)
bc25d6d
to
e4487d8
Compare
…splits Currently, `jj split` moves bookmarks from the target revision to the second revision created by the split. Since the first revision inherits the change id of the target revision, moving the bookmarks to the first revision is less surprising (i.e. the bookmarks stay with the change id). This no-implicit-move behavior also aligns with how `jj abandon` drops bookmarks instead of moving them to the parent revision. Two releases from now, `jj split` will no longer move bookmarks to the second revision created by the split. Instead, local bookmarks associated with the target revision will move to the first revision created by the split (which inherits the target revision's change id). You can opt out of this change by setting `split.legacy-bookmark-behavior = true`, but this will likely be removed in a future release. You can also try the new behavior now by setting `split.legacy-bookmark-behavior = false`. Users who have not opted into the new behavior via the config setting will see a warning when they run `jj split` informing them about the change. The default behavior be changed in the future. The `jj split` tests for bookmarks are updated to run in all three configurations: - Config setting enabled - Config setting disabled - Config setting unset #3419
e4487d8
to
cadaaeb
Compare
I am going to submit this since at this point we are just going back and forth on how and when the warning should be printed, and there's still time to adjust that. For what it's worth, I agree with @emilazy that it's not great to force users that want the new behavior to adjust their config to silence the warning. However, I thought the reason we added the warning in the first place was to avoid confusing users by changing the behavior silently (not everyone reads the patch notes). I think the current plan is:
Please open a new PR if anyone thinks we should change the plan. |
`jj split --parallel` now sets the working copy revision (`@`) to the first revision created by the split instead of the second. As a result, `@` remains on the same change id before and after the split. There is no good reason to choose the second commit as the working copy commit after a --parallel split. The only reason it works that way today is because doing that didn't require any code changes compared to the non parallel split. Martin proposed this change in the review for #5618.
Currently,
jj split
moves bookmarks from the target revision to the secondrevision created by the split. Since the first revision inherits the change id
of the target revision, moving the bookmarks to the first revision is less
surprising (i.e. the bookmarks stay with the change id). This no-implicit-move
behavior also aligns with how
jj abandon
drops bookmarks instead of movingthem to the parent revision.
Two releases from now,
jj split
will no longer move bookmarks to the secondrevision created by the split. Instead, local bookmarks associated with the
target revision will move to the first revision created by the split (which
inherits the target revision's change id). You can opt out of this change by
setting
split.legacy-bookmark-behavior = true
, but this will likely beremoved in a future release. You can also try the new behavior now by setting
split.legacy-bookmark-behavior = false
.Users who have not set the new config option will see a warning when they run
jj split
informing them about the change.The
jj split
tests for bookmarks are updated to run in all three configurations:Checklist
If applicable:
CHANGELOG.md