gitbutlerapp/gitbutler · error
implement list and call recursively
Error message
implement list and call recursively
What it means
Running `but branch` with no subcommand in a CLI build compiled WITHOUT the `legacy` feature hits a `todo!` - plain branch listing is only implemented in the legacy path (`command::legacy::branch::handle_no_subcommand`). The non-legacy list implementation is still missing (crates/but/src/lib.rs:948).
Source
Thrown at crates/but/src/lib.rs:948
}
Some(alias_args::Subcommands::Add {
name,
value,
global,
}) => {
command::alias::add(&mut ctx, out, &name, &value, global.into())
.emit_metrics(metrics_ctx)?;
None
}
Some(alias_args::Subcommands::Remove { name, global }) => {
command::alias::remove(&mut ctx, out, &name, global.into())
.emit_metrics(metrics_ctx)?;
None
}
},
Subcommands::Branch(branch::Platform { cmd }) => match cmd {
#[cfg(not(feature = "legacy"))]
None => todo!("implement list and call recursively"),
#[cfg(feature = "legacy")]
None => {
command::legacy::branch::handle_no_subcommand(&mut ctx, out)?;
None
}
#[cfg(feature = "legacy")]
Some(branch::Subcommands::List {
filter,
local,
remote,
all,
no_ahead,
review,
no_check,
empty,
}) => {
command::legacy::branch::list_branches(
&mut ctx, out, filter, local, remote, all, no_ahead, review, no_check, empty,View on GitHub (pinned to caf1f223d3)
Solutions
- Rebuild with the legacy feature enabled: `cargo build -p but --features legacy`, then rerun `but branch`
- Use an explicit implemented subcommand instead of bare `but branch`
- Track upstream until the non-legacy branch list is implemented and the todo removed
Defensive patterns
Strategy: validation
Validate before calling
// Guard the bare-subcommand path in builds without legacy
#[cfg(not(feature = "legacy"))]
if cmd.is_none() {
anyhow::bail!("`but branch` without a subcommand requires a build with the 'legacy' feature; pass a subcommand or rebuild with --features legacy");
} Prevention
- Build with `--features legacy` when the plain `but branch` listing is needed
- Smoke-test the exact binary you ship with `but branch --help` before release
- Track feature-flag changes in packaging so non-legacy builds do not reach unimplemented subcommands
When it happens
Trigger: Building the `but` binary without `--features legacy`, then running `but branch` (no subcommand). With the feature enabled the same invocation routes to the legacy handler instead.
Common situations: Switching between legacy and non-legacy builds (feature-flag or packaging change); CI building the default feature set; users of experimental non-legacy builds.
Related errors
- swap connections of nodes as well
- this is a placeholder for where we will have to start handli
- Failed to parse diff header
- BUG: It should not be possible to omit sources
- Refusing to install symlink onto existing non-symlink at '{U
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/a6f0f529451ca8b7.
Report an issue: GitHub.