{"record":{"id":"03a80596ba47b8af","repo":"gitbutlerapp/gitbutler","slug":"no-rebase-steps-provided","errorCode":null,"errorMessage":"No rebase steps provided","messagePattern":"No rebase steps provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-rebase/src/lib.rs","lineNumber":146,"sourceCode":"        self\n    }\n\n    /// Performs a rebase on top of a given base, according to the provided steps, or fails if no step was provided.\n    /// It does not actually create new git references nor does it update existing ones, it only deals with\n    /// altering commits and providing the information needed to update refs.\n    ///\n    /// Use it to\n    ///\n    ///  - drop commits\n    ///  - insert new commits\n    ///  - reorder commits\n    ///  - rewrite the history at will\n    ///\n    /// **However, note that it will also make all input commits sequential, so the caller must assure\n    /// these actually form a 'line'.**\n    pub fn rebase(&mut self) -> Result<RebaseOutput> {\n        if self.steps.is_empty() {\n            return Err(anyhow!(\"No rebase steps provided\"));\n        }\n        let pick_mode = if self.rebase_noops {\n            PickMode::Unconditionally\n        } else {\n            PickMode::SkipIfNoop\n        };\n        rebase(\n            self.repo,\n            self.base,\n            self.base_substitute,\n            std::mem::take(&mut self.steps),\n            pick_mode,\n        )\n    }\n}\n\nimpl Rebase<'_> {\n    /// Pick, Merge and Fixup operations:","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-rebase/src/lib.rs#L128-L164","documentation":"RebaseBuilder::rebase executes the accumulated rebase steps and requires at least one step. This error is thrown when rebase() is called on a builder with an empty steps list, because there is no history rewrite to perform.","triggerScenarios":"Constructing an Editor/RebaseBuilder and calling .rebase() without pushing any RebaseStep entries — e.g. a code path where all candidate steps were filtered out beforehand.","commonSituations":"Automations that conditionally add steps (fixups, reference moves) and end up with zero steps when conditions don't match, then call rebase unconditionally.","solutions":["Check that steps is non-empty before calling rebase(), or return early instead","Push at least one RebaseStep (e.g. a Pick or Reference step) before running","Refactor callers to skip the rebase entirely when no operations are needed"],"exampleFix":"// before\neditor.rebase()?;\n// after\nif !editor.steps.is_empty() {\n    editor.rebase()?;\n}","handlingStrategy":"validation","validationCode":"fn run_rebase(editor: &mut Editor<...>) -> anyhow::Result<Option<RebaseOutput>> {\n    if editor.steps.is_empty() { return Ok(None); }\n    Ok(Some(editor.rebase()?))\n}","typeGuard":null,"tryCatchPattern":"if editor.steps.is_empty() {\n    tracing::warn!(\"skipping rebase: no steps\");\n    return Ok(());\n}\nlet out = editor.rebase().context(\"rebase failed\")?;","preventionTips":["Check the step list before invoking rebase()","Skip the rebase flow entirely when no steps were added","Log why steps were filtered out so empty runs are visible"],"tags":["rebase","empty-input","validation"],"backgroundTag":"empty-required-field","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}