Commit 6325be2
committed
feat: add integration detection for squash-merged branches
Improve branch cleanup detection with four ordered checks to identify when
branch content is already in the target branch. This enables accurate removal
of squash-merged branches even after target advances.
**New integration checks (in cost order):**
- Same commit: Branch HEAD is literally the same commit as target
- No added changes: Three-dot diff shows no file changes beyond merge-base
- Tree contents match: Tree SHA equals target's tree SHA
- Merge simulation: Merging branch into target adds nothing (--full only)
**Status symbols updated:**
- `·` for same commit (cheapest check)
- `⊂` for content integrated via different history (all other cases)
Previously used `≡` (matches main) and `_` (no commits) which were ambiguous.
The new symbols better represent the checked conditions.
**Implementation:**
- Add `IsAncestorTask`, `HasFileChangesTask`, `WouldMergeAddTask` to task DAG
- Add `is_ancestor`, `has_file_changes`, `would_merge_add` fields to `ListItem`
- Create `IntegrationReason` enum for type-safe reason tracking
- Update `is_potentially_removable()` logic with ordered checks
- Refine `BranchOpState` variants to map to integration reasons1 parent efc8c5f commit 6325be2
File tree
61 files changed
+587
-238
lines changed- docs/content
- src
- commands/list
- git
- repository
- output
- tests
- integration_tests
- snapshots
- snapshots
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+587
-238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | | - | |
1466 | | - | |
| 1465 | + | |
| 1466 | + | |
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
| 1480 | + | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
| |||
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
1502 | | - | |
| 1502 | + | |
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
| |||
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | | - | |
| 1683 | + | |
1684 | 1684 | | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1688 | 1689 | | |
1689 | | - | |
| 1690 | + | |
1690 | 1691 | | |
1691 | 1692 | | |
1692 | 1693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
119 | 132 | | |
120 | 133 | | |
121 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
| |||
301 | 317 | | |
302 | 318 | | |
303 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
304 | 338 | | |
305 | 339 | | |
306 | 340 | | |
| |||
545 | 579 | | |
546 | 580 | | |
547 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
548 | 585 | | |
549 | 586 | | |
550 | 587 | | |
| |||
944 | 981 | | |
945 | 982 | | |
946 | 983 | | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
947 | 987 | | |
948 | 988 | | |
949 | 989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
212 | 311 | | |
213 | 312 | | |
214 | 313 | | |
| |||
461 | 560 | | |
462 | 561 | | |
463 | 562 | | |
| 563 | + | |
| 564 | + | |
464 | 565 | | |
465 | 566 | | |
466 | 567 | | |
| |||
476 | 577 | | |
477 | 578 | | |
478 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
479 | 583 | | |
480 | 584 | | |
481 | 585 | | |
| |||
513 | 617 | | |
514 | 618 | | |
515 | 619 | | |
| 620 | + | |
| 621 | + | |
516 | 622 | | |
517 | 623 | | |
518 | 624 | | |
| |||
525 | 631 | | |
526 | 632 | | |
527 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
528 | 637 | | |
529 | 638 | | |
530 | 639 | | |
| |||
0 commit comments