@@ -221,10 +221,17 @@ pub(crate) fn cmd_split(
221
221
// Prompt the user to select the changes they want for the first commit.
222
222
let target = select_diff ( ui, & tx, & target_commit, & matcher, & diff_selector) ?;
223
223
224
+ let legacy_bookmark_behavior = tx. settings ( ) . get_bool ( "split.legacy-change-id-behavior" ) ?;
225
+
224
226
// Create the first commit, which includes the changes selected by the user.
225
227
let mut first_commit = {
226
228
let mut commit_builder = tx. repo_mut ( ) . rewrite_commit ( & target. commit ) . detach ( ) ;
227
229
commit_builder. set_tree_id ( target. selected_tree . id ( ) ) ;
230
+ if !legacy_bookmark_behavior {
231
+ // Generate a new change id so that the commit being split doesn't
232
+ // become divergent.
233
+ commit_builder. generate_new_change_id ( ) ;
234
+ }
228
235
let description = if !args. message_paragraphs . is_empty ( ) {
229
236
let description = join_message_paragraphs ( & args. message_paragraphs ) ;
230
237
if !description. is_empty ( ) {
@@ -269,10 +276,12 @@ pub(crate) fn cmd_split(
269
276
let mut commit_builder = tx. repo_mut ( ) . rewrite_commit ( & target. commit ) . detach ( ) ;
270
277
commit_builder
271
278
. set_parents ( parents)
272
- . set_tree_id ( new_tree. id ( ) )
279
+ . set_tree_id ( new_tree. id ( ) ) ;
280
+ if legacy_bookmark_behavior {
273
281
// Generate a new change id so that the commit being split doesn't
274
282
// become divergent.
275
- . generate_new_change_id ( ) ;
283
+ commit_builder. generate_new_change_id ( ) ;
284
+ }
276
285
let description = if target. commit . description ( ) . is_empty ( ) {
277
286
// If there was no description before, don't ask for one for the
278
287
// second commit.
0 commit comments