{"record":{"id":"2c56474ec5b98fd0","repo":"gitbutlerapp/gitbutler","slug":"could-not-determine-selected-review-template","errorCode":null,"errorMessage":"Could not determine selected review template","messagePattern":"Could not determine selected review template","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but/src/command/legacy/forge/review.rs","lineNumber":292,"sourceCode":"                } else {\n                    template.clone()\n                };\n                (label, template)\n            })\n            .collect::<Vec<_>>();\n        let template_options = nonempty::NonEmpty::from_vec(template_options)\n            .context(\"No review templates available\")?;\n        let selected_template = {\n            let mut input = out\n                .prepare_for_terminal_input()\n                .context(\"Human input required - run this in a terminal\")?;\n            input\n                .prompt_select(\n                    \"Select a review template (and press Enter)\",\n                    &template_options,\n                )?\n                .cloned()\n                .ok_or_else(|| anyhow::anyhow!(\"Could not determine selected review template\"))?\n        };\n        let message = format!(\"Set review template path to: {}\", &selected_template);\n        but_api::legacy::forge::set_review_template(ctx, Some(selected_template.clone()))?;\n        if let Some(out) = out.for_human() {\n            writeln!(out, \"{message}\")?;\n        }\n    }\n\n    Ok(())\n}\n\n/// Create a new forge review for a branch.\n/// If no branch is specified, prompts the user to select one.\n/// If there is only one branch without a an acco, asks for confirmation.\n#[expect(clippy::too_many_arguments)]\npub async fn create_review(\n    ctx: &mut Context,\n    branch: Option<String>,","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/forge/review.rs#L274-L310","documentation":"When setting a forge review template and multiple templates are available, the command shows a prompt_select picker; this error occurs when the picker is cancelled (returns None) so no template path is chosen. The previously-guarded empty-list case is handled by the 'No review templates available' context, so reaching this line means templates existed but no selection was confirmed. Nothing is written (set_review_template is only called after selection).","triggerScenarios":"Running the review-template set command with several templates configured, then pressing Esc/Ctrl-C in the 'Select a review template' picker.","commonSituations":"User browsing available templates before deciding; aborting to inspect template contents first.","solutions":["Re-run and confirm a template with Enter.","If you already know the path, pass it directly as the argument to skip the picker.","Verify templates exist where the tool looks (.gitbutler/template dirs / configured paths) if the list surprises you."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Skip the picker by passing the template path explicitly when known\n// e.g. but forge review set-template .gitbutler/template/default.md","typeGuard":null,"tryCatchPattern":"match set_review_template_interactive(out).await {\n    Err(e) if e.to_string().contains(\"Could not determine selected review template\") => {\n        println!(\"Template selection cancelled; no change made.\"); Ok(())\n    }\n    other => other,\n}","preventionTips":["Pass the template path directly to avoid the interactive step.","Keep templates in the conventional location so the list stays meaningful."],"tags":["interactive","picker","forge","review-template"],"backgroundTag":"prompt-cancelled","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}