Skip to content

Commit eb61082

Browse files
committed
fix: remove ability to set default_pick_mode on graph editor
Review pointed out that setting PickMode::Force as the default pick mode for the editor is exceptionally unlikely to be useful, as that would forcibly cherry-pick potentially thousands of resolved commits in the graph.
1 parent f8e9181 commit eb61082

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

crates/but-rebase/src/graph_rebase/creation.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@ use petgraph::{Direction, visit::EdgeRef as _};
77

88
use crate::graph_rebase::{
99
Checkout, Edge, Editor, Pick, RevisionHistory, Selector, Step, StepGraph, StepGraphIndex,
10-
SuccessfulRebase, cherry_pick::PickMode, util,
10+
SuccessfulRebase, util,
1111
};
1212

1313
#[derive(Clone, Copy)]
1414
/// Options for the editor.
1515
pub struct GraphEditorOptions {
16-
/// Determines when picks are cherry-picked during a rebase.
17-
pub default_pick_mode: PickMode,
18-
/// Determines how resulting commits are signed.
16+
/// Determines how cherry-picked commits are signed.
1917
pub default_sign_commit: SignCommit,
2018
}
2119

2220
impl Default for GraphEditorOptions {
2321
fn default() -> Self {
2422
Self {
25-
default_pick_mode: PickMode::IfChanged,
2623
default_sign_commit: SignCommit::IfSignCommitsEnabled,
2724
}
2825
}
@@ -120,7 +117,6 @@ impl<'ws, 'meta, M: RefMetadata> Editor<'ws, 'meta, M> {
120117
Pick::new_workspace_pick(commit.id)
121118
} else {
122119
let mut pick = Pick::new_pick(commit.id);
123-
pick.pick_mode = options.default_pick_mode;
124120
pick.sign_commit = options.default_sign_commit;
125121
pick
126122
};

crates/but-rebase/tests/rebase/graph_rebase/signing_preferences.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ fn force_picked_commit_with_sign_yes_is_signed_when_otherwise_unchanged() -> Res
202202
&mut *meta,
203203
&repo,
204204
&GraphEditorOptions {
205-
default_pick_mode: PickMode::IfChanged,
206205
default_sign_commit: SignCommit::No,
207206
},
208207
)?;
@@ -270,7 +269,6 @@ fn force_picked_ancestor_does_not_sign_descendants_picked_with_sign_commit_no()
270269
&mut *meta,
271270
&repo,
272271
&GraphEditorOptions {
273-
default_pick_mode: PickMode::IfChanged,
274272
default_sign_commit: SignCommit::No,
275273
},
276274
)?;
@@ -357,7 +355,6 @@ fn force_picked_ancestor_triggers_cascading_signatures_on_descendants_picked_wit
357355
&mut *meta,
358356
&repo,
359357
&GraphEditorOptions {
360-
default_pick_mode: PickMode::IfChanged,
361358
default_sign_commit: SignCommit::Yes,
362359
},
363360
)?;
@@ -442,7 +439,6 @@ fn commit_picked_with_sign_if_enabled_is_not_signed_when_signing_config_is_disab
442439
&mut *meta,
443440
&repo,
444441
&GraphEditorOptions {
445-
default_pick_mode: PickMode::IfChanged,
446442
default_sign_commit: SignCommit::IfSignCommitsEnabled,
447443
},
448444
)?;
@@ -510,7 +506,6 @@ fn parentless_commit_force_picked_with_sign_yes_is_signed() -> Result<()> {
510506
&mut *meta,
511507
&repo,
512508
&GraphEditorOptions {
513-
default_pick_mode: PickMode::IfChanged,
514509
default_sign_commit: SignCommit::IfSignCommitsEnabled,
515510
},
516511
)?;

0 commit comments

Comments
 (0)