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

  1. Rebuild with the legacy feature enabled: `cargo build -p but --features legacy`, then rerun `but branch`
  2. Use an explicit implemented subcommand instead of bare `but branch`
  3. 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

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


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/a6f0f529451ca8b7. Report an issue: GitHub.