{"record":{"id":"7d2f707639a159e9","repo":"gitbutlerapp/gitbutler","slug":"committing-stack-assignments-is-not-supported-use","errorCode":null,"errorMessage":"committing stack assignments is not supported. Use `but commit`","messagePattern":"committing stack assignments is not supported\\. Use `but commit`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/status/tui/app/commit_mode.rs","lineNumber":507,"sourceCode":"    ctx: &mut Context,\n    terminal_guard: &mut T,\n    messages: &mut Vec<Message>,\n    mode: &CommitMode,\n    commit_op: commit::CommitOperation,\n    stack_on_head: bool,\n) -> anyhow::Result<()>\nwhere\n    T: TerminalGuard,\n    anyhow::Error: From<<T::Backend as Backend>::Error>,\n{\n    let CommitMode {\n        source,\n        message_composer,\n        insert_side: _,\n        scope_to_stack,\n    } = mode;\n\n    anyhow::ensure!(\n        scope_to_stack.is_none(),\n        \"committing stack assignments is not supported. Use `but commit`\"\n    );\n\n    let commit_selection = match &**source {\n        // Marks can span checkouts, so this is where that gets rejected.\n        CommitSource::Marks(hunks) => commit::CommitSelection::Changes(Box::new(\n            UncommittedSelection::new(hunks.clone()).map_err(CliError::into_internal)?,\n        )),\n        CommitSource::UncommittedArea(source) => {\n            commit::CommitSelection::AllChanges(source.clone())\n        }\n        CommitSource::UncommittedHunk(hunk) => commit::CommitSelection::Changes(Box::new(\n            UncommittedSelection::new(NonEmpty::new(hunk.clone()))\n                .map_err(CliError::into_internal)?,\n        )),\n    };\n","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/status/tui/app/commit_mode.rs#L489-L525","documentation":"In the TUI's commit mode, `commit_with` rejects commits made with a `scope_to_stack` assignment set: assigning changes to a whole stack/branch is not something the inline TUI commit supports, and the CLI `but commit` must be used instead. This is an intentional capability guard, not a bug.","triggerScenarios":"Committing in the TUI while the commit mode was opened with scope-to-stack assignment active (e.g. via `handle_commit_confirm` or `handle_commit_to_new_branch` with a stack-scoped selection).","commonSituations":"Selecting changes and choosing to assign them to another stack/branch during the commit flow in the TUI; attempting to restructure stack membership from the commit dialog.","solutions":["use `but commit` on the command line instead, which supports stack assignment flows","commit without the stack scope in the TUI, then reassign afterwards","use `but assign` (CLI) to move changes between stacks, then commit normally"],"exampleFix":"// before (TUI) commit with scope-to-stack selected -> rejected\n// after (shell)\nbut assign <file-id> <stack-id> && but commit -m \"message\"","handlingStrategy":"try-catch","validationCode":"if commit_mode.scope_to_stack.is_some() {\n    eprintln!(\"Use `but commit` from the CLI for stack-scoped commits\");\n}","typeGuard":null,"tryCatchPattern":"match commit_with(ctx, mode) {\n    Err(e) if e.to_string().contains(\"not supported. Use `but commit`\") => {\n        eprintln!(\"Fall back to `but assign` + `but commit` on the CLI.\");\n    }\n    other => other?,\n}","preventionTips":["don't combine stack scoping with the TUI commit flow","use `but assign` first, then commit without scope","check the TUI commit dialog for the stack-scope toggle before confirming"],"tags":["tui","unsupported-operation","stacks"],"backgroundTag":"unsupported-operation","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"}