{"record":{"id":"a6f0f529451ca8b7","repo":"gitbutlerapp/gitbutler","slug":"implement-list-and-call-recursively","errorCode":null,"errorMessage":"implement list and call recursively","messagePattern":"implement list and call recursively","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/lib.rs","lineNumber":1014,"sourceCode":"                }\n                worktree::Subcommands::Unarchive { worktree } => {\n                    let outcome = command::worktree::archive::set_archived(&ctx, &worktree, false)?;\n                    out.print_cli_output(outcome)?;\n                }\n                worktree::Subcommands::Remove { force, worktree } => {\n                    let outcome = command::worktree::remove::remove(&mut ctx, &worktree, force)?;\n                    out.print_cli_output(outcome)?;\n                }\n                worktree::Subcommands::New { name } => {\n                    let outcome = command::worktree::new::new(&mut ctx, name.as_ref())?;\n                    out.print_cli_output(outcome)?;\n                }\n            }\n            None\n        }\n        Subcommands::Branch(branch::Platform { cmd }) => match cmd {\n            #[cfg(not(feature = \"legacy\"))]\n            None => todo!(\"implement list and call recursively\"),\n            #[cfg(feature = \"legacy\")]\n            None => {\n                command::legacy::branch::handle_no_subcommand(&mut ctx, out)?;\n                None\n            }\n            #[cfg(feature = \"legacy\")]\n            Some(branch::Subcommands::List {\n                filter,\n                local,\n                remote,\n                all,\n                no_ahead,\n                review,\n                no_check,\n                empty,\n            }) => {\n                command::legacy::branch::list_branches(\n                    &mut ctx, out, filter, local, remote, all, no_ahead, review, no_check, empty,","sourceCodeStart":996,"sourceCodeEnd":1032,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/lib.rs#L996-L1032","documentation":"In crates/but/src/lib.rs dispatch_subcommand, the `but branch` command with no subcommand panics via todo!(\"implement list and call recursively\") when the binary is built without the \"legacy\" feature. With the legacy feature, it delegates to command::legacy::branch::handle_no_subcommand instead.","triggerScenarios":"Running `but branch` (no subcommand) on a non-legacy build — the cfg arm selects the todo!() and the CLI panics.","commonSituations":"Installing `but` from a build without the legacy feature and trying the bare `but branch` listing command; CI scripts relying on the legacy shorthand against a modern build.","solutions":["Use `but branch list` explicitly, which avoids the no-subcommand arm.","Build/install the CLI with the legacy feature enabled (cargo build --features legacy) to get the historical bare-branch behavior.","Implement the non-legacy path in crates/but/src/lib.rs: list branches and recurse into the branch subcommand dispatch."],"exampleFix":"// before\nbut branch\n// after\nbut branch list","handlingStrategy":"validation","validationCode":"# shell guard before invoking\nif but branch --help 2>/dev/null | grep -q list; then\n  but branch list\nelse\n  echo \"bare 'but branch' unsupported on this build\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit subcommand (`but branch list`) instead of relying on bare-command shorthands.","Match your build's feature set: legacy builds allow `but branch` bare.","Check `but --version` / build features in CI scripts."],"tags":["rust","cli","panic","unimplemented","feature-flags"],"backgroundTag":"method-not-implemented","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"}