Repository navigation
Conversation
Adding a project always cloned the repository's default branch, so a floor could only ever start on main. The elevator's "add a project" now has a Branch row under the repository list: the default branch unless another of the repository's is picked, which the office asks GitHub for as soon as someone picks the repository. The clone stays a full clone — the picked branch is git's own `--branch` after the `--`, so the floor still has every branch to work from and only its checkout starts where they picked. A checkout already on disk (a floor taken off the building, or one cloned by hand) is moved onto the picked branch with `git checkout`, which makes it from origin if it isn't there yet and refuses rather than losing work on a dirty one. `floor.add`'s branch is optional end to end, so the CLI paths are unchanged, and branch names are checked against git's own rules on the way in, so a hand-written message can never reach `git clone --branch` or `git checkout` with something else in it. The GitHub listing moved to `src/server/repos.ts`, which keeps building.ts within its size budget. Co-Authored-By: [CC] <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a project always cloned the repository's default branch, so a new floor could only ever start on
main. The elevator's Add a project now has a Branch row under the repository list.What it does
gh api repos/<owner>/<name>/branches) as soon as a repository is picked, debounced while typing. A repository's default branch is always offered, even if the list was cut short before it, and each floor's row now shows the branch its checkout is on (acme/api · 🌿 feature/login).--branchafter the--, so the floor still has every branch to work from and only its checkout starts where they picked.git checkout— which makes it from origin if it isn't there yet, and refuses rather than losing work on a dirty one.branchis optional end to end, soagent-office setup --project owner/repoand the other CLI paths are unchanged.normalizeBranch) on the way in, both for whatghhands back and for what a client sends, so a hand-written message can never reachgit clone --branchorgit checkoutwith an option, a path or a revision of its own.Where it lives
src/shared/floors.ts:normalizeBranch.src/shared/protocol/floors.ts:BranchChoices,branchonfloor.add, andfloor.branchesboth ways.src/server/repos.ts(new): theghlistings —listReposandlistBranches— moved out ofbuilding.ts, which keeps it within the 600-line budget.Building.repos()/Building.branches()call into them.src/server/clone.ts:CloneRunOptions.branch, passed togh repo cloneas--branch.src/server/ws/handlers/floors.ts: thefloor.brancheshandler.src/client/ui/elevator.ts+elevator.css: the Branch row and the branch on each floor's row.README.md,docs/features.md,docs/how-it-works.md: the picker, and what the clone does with it.Verified
npm run typecheck,npm test(618 pass, including new cases for a clone onto a picked branch, a refused branch name, a checkout on disk put on a branch, and the branch list's filtering) andnpm run build.🤖 Generated with [CC]