Skip to content

A pushed branch names itself, and the compare's clone knows it as origin's - #116

Merged
feitreim merged 1 commit into
mainfrom
fix/compare-train-ref-resolution
Aug 6, 2026
Merged

feitreim merged 1 commit into
mainfrom
fix/compare-train-ref-resolution

Conversation

@feitreim

@feitreim feitreim commented Aug 6, 2026

Copy link
Copy Markdown
Owner

compare_train (the #115 harness) clones fresh and adds each arm as a git worktree add --detach. That flag turns off the DWIM that would otherwise read a bare branch name as origin/<name>, and a fresh clone carries no local branch but the one it checked out. So --ref <branch> died on fatal: invalid reference: <branch> for every pushed branch; main worked only because it is the clone's checked-out branch, which made the harness able to compare main against main and nothing else.

Resolve each arm's ref against the clone before handing it to the worktree: as given first, so a tag or a commit SHA keeps working, then origin/<ref>.

Checked against a fresh clone of this repo:

'main'                     -> 'main'
'bf16-expert-buffers'      -> 'origin/bf16-expert-buffers'
'origin/batch-size-sweep'  -> 'origin/batch-size-sweep'
'no-such-branch'           -> SystemExit: ref no-such-branch is neither a ref nor a branch on origin

and git worktree add --quiet --detach <path> origin/bf16-expert-buffers lands on 1e455df, where the bare name fails with exit 128.

No GPU run: the change is upstream of the build and neither arm's source nor either binary moves.

…gin's

`compare_train` clones fresh and adds each arm as a `--detach` worktree.
That flag turns off the DWIM that would otherwise read a bare branch name
as `origin/<name>`, and a fresh clone has no local branch but the one it
checked out -- so `--ref <branch>` died on `fatal: invalid reference` for
every branch except `main`, which is the only one the harness could ever
compare.

Resolve each arm's ref before handing it to the worktree: as given first,
so tags and commits keep working, then `origin/<ref>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant