Commit fc4fd5b
authored
rebase-branch: recognize space-aligned Copilot stats trailer (#163)
The [scheduled `rebase-shears`
run](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/24401147325/job/71271793472)
failed today with:
```
##[error]Unexpected AI decision '': 6c02c9d442 tests: use the correct path separator with BusyBox
##[error]Rebase failed for shears/seen
```
The AI (Copilot CLI with `claude-opus-4.6`) actually resolved the
`t/test-lib.sh` conflict correctly and output a valid decision:
```
continue -- kept both HEAD's `set -e` and REBASE_HEAD's `PATH_SEP` block as independent additions
```
But the `sed` state machine that extracts this decision from the Copilot
output returned empty. The parser validates that everything after the
decision line is blank lines and stats-like trailer lines before
accepting it. The trailer the Copilot CLI actually emits looks like
this:
```
Changes +1 -3
Requests 3 Premium (38s)
Tokens 127.5k ↓ 1.5k 53.9k (cached)
```
These are space-aligned (word followed by 2+ spaces then value), but the
`sed` script only recognized `key: value` lines (colon-separated). The
stats lines were rejected, causing `sed` to discard the held decision
and return nothing.
The fix adds a second pattern in the `:stats` section that matches lines
starting with an alphabetic word followed by two or more spaces,
alongside the existing colon-based recognizer.1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
280 | 284 | | |
281 | 285 | | |
282 | 286 | | |
| |||
0 commit comments