Skip to content

Commit 096a2fd

Browse files
committed
but branch list improvements
Enhance branch listing with richer filtering and options: - support remote/local/all, ahead and review flags, JSON output parameter stubs - fetch review info only when --review is requested - filter applied stacks and their heads when a name filter is provided - remove branches that belong to applied stacks early - apply name and dependabot filters and more robust retention logic Refactor list signature and internal flow to build and filter the branch list incrementally, improving performance and correctness. more more Add --check to "but branch list" to test mergeability Add a --check flag to the branch list command that computes whether each listed branch can be cleanly merged into the upstream target branch. This introduces a merge status map propagated into list rendering (JSON and table views) and a new helper check_branches_merge_cleanly that uses repository/Gix APIs to detect merge bases and whether trees merge cleanly. The change updates branch output structs to include merges_cleanly, wires the new check option through CLI parsing, prints a brief stderr message when checking, and appends a ✓/✗ indicator next to the commits-ahead column in table output. It also handles fallback behavior when references or merge bases are missing by treating them as conflicts or skipping missing commits. Move merge check indicator to left and enable by default Move the merge status indicator (✓/✗) to the left of branch names in the branch list output so the check appears immediately before the branch/tree prefix. Also change the CLI flag semantics so checking merges is enabled by default and controlled with --no-check instead of requiring --check. This improves the readability of branch rows and makes safe merge-checking the default behavior.
1 parent 8719597 commit 096a2fd

File tree

7 files changed

+1128
-71
lines changed

7 files changed

+1128
-71
lines changed

Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/but/Cargo.toml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,20 @@ gitbutler-command-context.workspace = true
5050
gitbutler-reference.workspace = true
5151
gitbutler-oplog.workspace = true
5252

53+
git2.workspace = true
54+
async-openai.workspace = true
5355
posthog-rs = { version = "0.3.7" }
5456
serde.workspace = true
5557
tokio = { workspace = true, features = ["rt-multi-thread", "io-std"] }
5658
strum = { version = "0.27", features = ["derive"] }
57-
clap = { workspace = true, features = ["env", "wrap_help", "color", "error-context", "usage", "suggestions" ] }
59+
clap = { workspace = true, features = [
60+
"env",
61+
"wrap_help",
62+
"color",
63+
"error-context",
64+
"usage",
65+
"suggestions",
66+
] }
5867
clap_complete = "4.5.60"
5968
chrono.workspace = true
6069
bstr.workspace = true
@@ -76,7 +85,12 @@ tracing-forest.workspace = true
7685
ratatui = "0.29.0"
7786
crossterm = "0.29.0"
7887
cli-prompts = "0.1.0"
79-
minus = { version = "5.6.1", default-features = false, features = ["static_output", "search"] }
88+
minus = { version = "5.6.1", default-features = false, features = [
89+
"static_output",
90+
"search",
91+
] }
92+
unicode-width = "0.1"
93+
term_size = "0.3"
8094

8195
[dev-dependencies]
8296
but-core = { workspace = true, features = ["testing"] }

0 commit comments

Comments
 (0)