Repository navigation
adopt-project.py: a --work-dir that is a file or cannot be made ends plan, check and execute in a traceback, and --help says nothing of --work-dir or of where --org comes from #650
Description
Lane: openreposhape-1 (openRepoShape-1)
plan, check and execute should refuse a --work-dir that is a file, or that cannot be made, by name and in one place, not end in a traceback. --help should say what --work-dir is and where --org comes from.
From lane 1's triage of 2026-10-15, D2, approved by Brett Heap at 2026-10-16T11:21:17Z ("Approve all (Recommended)"). One pull request covers the lines below.
Parent: #457. Milestone: v1.1.0.
Lands after: #594, which rewrites _work_root and main.
Effort: S. Platform: all.
Lane openRepoShape-1 claims it at filing; see its CLAIMED comment.
Why this is P2. Probed on 396c0ff, before any leg exists:
plan --work-dir <a file>ends inFileExistsError, exit 1.plan --source acme/Atlasends inPermissionError, exit 1, both with a work dir under achmod 500directory and with that directory itself.- adopt-project.py and tests/conftest.py: a run without
--work-dirremoves the empty work directory it made, and a recorded clone that is gone is cloned again, so no emptyopenreposhape-adopt-*is left and nosource-unclonablefollows (#526) #594's head keeps_work_root's baremkdir.
Read on 7ba64f0: _work_root still ends in a bare mkdir, and cmd_plan, cmd_check and cmd_execute each call it with no handler. #524 (#581) made check and execute refuse an unwritable directory by name. What is left is plan, and a directory that cannot be made.
One pull request covers it:
- one refusal by name, in all three commands;
except (OSError, Refusal)incmd_check(L1-21);- the work-dir question asked before the "is cloned again" NOTE (L1-28);
- help text for
--work-dirand--org(L1-25, L1-49), so docs/cli.md is regenerated once.
Lane 2's L2-55 on #457 (issuecomment-6202569293) sits in the same lines: flag-only refusals asked before _work_root. It could join this issue.
Lines
- L1-19 (P2): a
--work-dirthat cannot be made, or is a file, gives a PermissionError or FileExistsError traceback from_work_root'smkdirinplan,checkandexecute, before any leg. Where:_work_root. On 396c0ff, probed:plan --work-dir <a file>ends inFileExistsError, exit 1. Read again on 7ba64f0: themkdiris bare, and the three commands call_work_rootwith no handler. The line measured it on 17dd55c. (source) - L1-20 (P2):
plan --source <org/repo>with an unwritable--work-dirends in a PermissionError traceback atsource-readonly;checkandexecutenow refuse the same case. On 396c0ff, probed:plan --source acme/Atlasends inPermissionError, exit 1. The line measured it on 17dd55c. (source) - L1-25 (P2):
--work-dirhas no help text onplan,checkorexecute, and docs/cli.md does not say where the default lands or that it is removed when empty. On 396c0ff, read: nohelp=. Read again on 7ba64f0:--work-dirand--orgstill have nohelp=. The line saw it on 652b686. (source)
Rides along (backlog; tick it here if the same change covers it)
- L1-21: with an unwritable
--work-dirand an unopenable--source,checkrefusessource-unresolvableandexecuterefusesadopt-work-dir-unwritable.cmd_checkconverts onlyOSError, soexcept (OSError, Refusal):would align them. On 396c0ff, read:except OSErroronly. Read again on 7ba64f0: unchanged. The line measured it on 17dd55c. (source) - L1-28: with adopt-project.py:
checkfinds, andexecuterefuses before any leg exists, a path the root keeps at the shape's own pin and a--work-dirthis user cannot write in, socontracts/shape-pin.yamlkept in the root and achmod 500work directory no longer passcheckand fail only after both legs are pushed (#524) #581 merged, an unwritable--work-dirplus a gone recorded clone makescheckprint the "is cloned again" NOTE and then refuseadopt-work-dir-unwritable, whileexecuterefuses with no NOTE. Fix: ask the work-dir question before the NOTE. On be808a7, adopt-project.py and tests/conftest.py: a run without--work-dirremoves the empty work directory it made, and a recorded clone that is gone is cloned again, so no emptyopenreposhape-adopt-*is left and nosource-unclonablefollows (#526) #594's head, read: the NOTE is adopt-project.py and tests/conftest.py: a run without--work-dirremoves the empty work directory it made, and a recorded clone that is gone is cloned again, so no emptyopenreposhape-adopt-*is left and nosource-unclonablefollows (#526) #594's. The line probed it on 652b686 merged with adopt-project.py:checkfinds, andexecuterefuses before any leg exists, a path the root keeps at the shape's own pin and a--work-dirthis user cannot write in, socontracts/shape-pin.yamlkept in the root and achmod 500work directory no longer passcheckand fail only after both legs are pushed (#524) #581's head edaaae4. (source) - L1-49: AGENTS.md's adoption step and
plan --help's--orgnever say that--orgdefaults to the organisation of a urlorigin, or that a pathoriginneeds it. On 396c0ff, read: adopt-project.py:10336. Read again on 7ba64f0:--orgstill has nohelp=. The line read it on 182389e. (source)
Each line above is a line of #457's checklist comment (issuecomment-6200110061). Tick it there too when this closes.
The lines as written on the tracking issue
[L1-19] A
--work-dirthat cannot be made, or is a file, gives a PermissionError or FileExistsError traceback from_work_root'smkdirinplan,checkandexecute, before any leg. Measured on 17dd55c (repro kept by lane 1). (Found in #581's writer.)
[L1-20]
plan --source <org/repo>with an unwritable--work-dirends in a PermissionError traceback atsource-readonly;checkandexecutenow refuse the same case. Measured on 17dd55c. (Found in #581's writer and review.)
[L1-25]
--work-dirhas no help text onplan,checkorexecute, and docs/cli.md does not say where the default lands or that it is removed when empty. Seen on 652b686. (Found in #594's writer and review.)
[L1-21] With an unwritable
--work-dirand an unopenable--source,checkrefusessource-unresolvableandexecuterefusesadopt-work-dir-unwritable.cmd_checkconverts onlyOSError, soexcept (OSError, Refusal):would align them. Measured on 17dd55c (repro kept by lane 1). (Found in #581's review.)
[L1-28] With #581 merged, an unwritable
--work-dirplus a gone recorded clone makescheckprint the "is cloned again" NOTE and then refuseadopt-work-dir-unwritable, whileexecuterefuses with no NOTE. Probed on 652b686 merged with #581's head edaaae4. (Found in #594's review.)
[L1-49] AGENTS.md's adoption step and
plan --help's--orgnever say that--orgdefaults to the organisation of a urlorigin, or that a pathoriginneeds it. Read at 182389e. (Found in #591's review.)
Activity
brettheap commentedon Oct 16, 2026
CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-16T11:37:28Z, for #650
Logged in
lanes/log/openRepoShape-1.mdat7cb8c4ba4bf14dba74dfc0cd20bd1f09d01ff106.The three reads (lane-collision-protocol Rule 1):
Merge main 2fac979 into fix/417-adopt-check-local-remote-dir
family.py: `add`'s refusal of a member's own gitlink held only under …
adopt-project.py: a `--work-dir` under a directory another user can r…
adopt-project.py: a symlink loop or a file above the `--work-dir` keeps
adopt-project.py: a `--source`, or a plan's `source.local_path`, that…
adopt-project.py: the clone `plan` and `check` make is claimed with t…
tests/test_adopt_clone_claimed.py: a `--work-dir` under a symlink loo…
adopt-project.py: a `--work-dir` that is, or runs through, a symlink …