You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adopt-project.py: _default_branch reads origin/HEAD and HEAD by short name, so a source cloned with git clone -b <branch> is refused git-failed with no remedy, and a HEAD on a local origin/x or on a name ending in U+00A0 adopts another branch's commit #797
Goal: the default branch adopt-project.py reads is a branch the source has, read by its full ref name and its exact bytes. A source whose origin/HEAD names a branch with no local copy is refused with a remedy that works, and --tracking-branch does not depend on the default branch.
Filed by lane openRepoShape-1 from #457's lines L1-68, L1-69 and L1-71 (#457, comment) on Brett Heap's word of 2026-10-17T10:21:32Z, under lane 3's v1.1.1 rule (#473, issuecomment-6216697223). Each line was measured again on main bf1f099b with a stub gh.
Milestone: v1.1.1. L1-71's second case is reached by an ordinary git clone -b <branch>, or a deleted local main. It stops plan, check and execute with git's own words and no way out, and the obvious flag does not help. L1-68 and L1-69 are silent wrong commits, but need unusual branch names.
Lines
L1-71, case 2: origin/HEAD names a branch with no local copy.
After git clone -b dev <url>, origin/HEAD names origin/main and only dev is local. plan gives REFUSED git-failed: \git rev-parse main` … fatal: ambiguous argument 'main': unknown revision…`, exit 2, with no Remediation line.
plan --tracking-branch dev is refused the same way, because Source._at runs rev-parse on the default branch first.
check on a plan made before the local main went away gives the same refusal.
After git branch main origin/main, plan exits 0.
L1-68: a HEAD on main followed by U+00A0, beside a branch main.plan exits 0 and records default_branch: main and the commit of the OTHER branch. .strip() after decoding removes the U+00A0.
L1-69: a HEAD on a local branch named origin/x, beside a branch x.plan exits 0 and adopts x's commit, because origin/ is stripped from the HEAD read too.
L1-71, case 1 (rider): a source whose only branch is café. It is refused unsafe-value with only the pattern as its remedy. The way through works: git branch main, then --tracking-branch main, exits 0. The remedy should say so.
Use origin/HEAD's branch only where refs/heads/<b> exists.
Otherwise refuse by name, with the way out: git branch <b> origin/<b>, or pass --tracking-branch <a branch the source has>. Never silently adopt another branch.
--tracking-branch must work without the default branch resolving: Source._at asks rev-parse of refs/heads/<b> only for the branch it needs.
Source._at resolves refs/heads/<b>, never a short name a tag can shadow.
Tests: extend tests/test_adopt_branch_names.py, tests/test_adopt_tracking_branch.py and tests/test_adopt_git_reads.py.
A clone -b dev source: refused with the remedy, and adopted with --tracking-branch dev.
Overlaps:#765 is the sibling for update-shape.py, family.py and bump-leg.py, and lane 1 holds it too. _default_branch reads with binary=True, so #710's decode rule does not reach it.
CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-17T10:43:48Z, for #797
Logged in lanes/log/openRepoShape-1.md at 388085d9734f00c568cf3365c7dac83aeba1f2c1.
The three reads (lane-collision-protocol Rule 1):
1. existing `CLAIMED —` comments on opensoft/openRepoShape#797:
none
2. `gh pr list --repo opensoft/openRepoShape --state all --search "#797"`, kept where the row or its body names `#797`:
none
3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `797` as a whole token:
none
Activity
brettheap commentedon Oct 17, 2026
CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-17T10:43:48Z, for #797
Logged in
lanes/log/openRepoShape-1.mdat388085d9734f00c568cf3365c7dac83aeba1f2c1.The three reads (lane-collision-protocol Rule 1):
adopt-project.py: `_default_branch` reads `origin/HEAD` and HEAD by f…
adopt-project.py: `_default_branch` refuses by name any default branc…
Merge origin/main 3fb30a8 into fix/796-adopt-source-spellings
Merge main fc289dd into fix/803-adopt-clone-claimed (#803)