Commit 096a2fd
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- crates/but
- src
- branch
- tests/but/snapshots/from-workspace
7 files changed
+1128
-71
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
79 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
80 | 94 | | |
81 | 95 | | |
82 | 96 | | |
| |||
0 commit comments