Skip to content

breaking(but): remove but branch show in favor of but show#13518

Draft
slarse wants to merge 3 commits intomasterfrom
GB-1312/remove-but-branch-show
Draft

breaking(but): remove but branch show in favor of but show#13518
slarse wants to merge 3 commits intomasterfrom
GB-1312/remove-but-branch-show

Conversation

@slarse
Copy link
Copy Markdown
Contributor

@slarse slarse commented Apr 24, 2026

They are almost identical in functionality, but but branch show has three features that but show does not have:

  1. The ability to fetch review information
  2. The ability to check integration status
  3. The ability to show branches not in the workspace

Point 3 is more of a bug in but show than a missing feature, it just shows an empty branch for any branch that is not applied. That will be fixed, and if there is any kind of demand we can reimplement review and merge checking.

This PR leaves a skeleton implementation of but branch show that simply tells the user to use but show instead.

@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Apr 24, 2026
@slarse slarse force-pushed the GB-1312/remove-but-branch-show branch from b459548 to 88787d6 Compare April 24, 2026 13:17
@slarse slarse marked this pull request as ready for review April 24, 2026 13:18
Copilot AI review requested due to automatic review settings April 24, 2026 13:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the legacy but branch show implementation and routes users to the newer but show command, keeping a hidden deprecated branch show subcommand that errors with guidance to preserve CLI compatibility.

Changes:

  • Replace but branch show execution with an explicit error directing users to but show.
  • Remove the legacy branch show implementation code and associated tests.
  • Update CLI metrics naming to stop emitting a distinct BranchShow command metric.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/but/src/lib.rs Makes but branch show fail with a deprecation/removal message pointing to but show.
crates/but/src/args/branch.rs Keeps a hidden branch show subcommand that accepts any trailing args for compatibility.
crates/but/src/args/metrics.rs Removes the BranchShow metric command name variant.
crates/but/src/utils/metrics.rs Maps branch show invocations to BranchList for metrics emission.
crates/but/src/command/legacy/branch/mod.rs Removes the legacy show_branches entrypoint and module wiring.
crates/but/src/command/legacy/branch/show.rs Deletes the legacy implementation of but branch show.
crates/but/tests/but/command/branch/mod.rs Stops compiling the removed branch show test module.
crates/but/tests/but/command/branch/show.rs Deletes tests that validated the old but branch show behavior.

Comment thread crates/but/src/lib.rs
Comment thread crates/but/src/lib.rs
slarse added 2 commits April 24, 2026 21:19
They are almost identical in functionality, but `but branch show` has
three features that `but show` does not have:

1. The ability to fetch review information
2. The ability to check integration status
3. The ability to show branches not in the workspace

Point 3 is more of a bug in `but show` than a missing feature, it just
shows an empty branch for any branch that is not applied. That will be
fixed, and if there is any kind of demand we can reimplement review and
merge checking.
Copilot AI review requested due to automatic review settings April 24, 2026 19:22
@slarse slarse force-pushed the GB-1312/remove-but-branch-show branch from d42e426 to b436993 Compare April 24, 2026 19:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

@@ -1,5 +1,4 @@
mod apply;
mod list;
mod new;
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the branch/show.rs test module drops the only CLI coverage for the “show commits ahead for a branch” JSON behavior. Since but branch show is being replaced by but show, consider porting these tests to exercise but show <branch> (and --verbose if that’s the equivalent of the old --files) so the user-visible behavior remains covered.

Suggested change
mod new;
mod new;
mod show;

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a good find that might be relevant. The JSON output from but show does not contain commits_ahead. It's trivial to compute with e.g. but --json show <id> | jq '.commits | length', but still it's probably convenient to have there.

The JSON output of but show is also more verbose than but branch show in that it contains commit details (e.g. files) by default. Perhaps that will have a negative impact on agents. Some more consideration is necessary before making this switch.

Comment thread crates/but/src/args/branch.rs
@slarse slarse marked this pull request as draft April 26, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants