Work the monorepo from one clone with a worktree per MR

The skill told an agent to clone gitlab-org/gitlab fresh for each task, banned blobless clones, and never removed one. One laptop held 69 copies and 67 GB.

flowchart TD
  A[Change] --> B{Docs or one file?}
  B -- yes --> C[API, no clone]
  B -- no --> D[Canonical clone: fetch origin/master]
  D --> E{At the cap?}
  E -- yes --> F[Reap, block if still full] --> G
  E -- no --> G[worktree-add, sparse paths]
  G --> H[Work, commit, push]
  H --> I[RSpec and RuboCop on the dev rig]
  I --> J[MR closes]
  J --> K[Reap]

just contrib reap removes only merged or closed MRs, with git worktree remove and no --force. It refuses a worktree that is dirty, has commits its push remote lacks, or has an unreadable MR state.

The cap is 40 (--cap, CONTRIB_WORKTREE_CAP); at it, worktree-add reaps first. Ten is the target. reap --stale lists idle no-MR worktrees and removes none.

The blobless ban is dropped. On the canonical clone, in a scratch worktree:

  • add, sparse set, populate: 2.5 s, 32 MB
  • fetch origin '+refs/heads/master:refs/remotes/origin/master': 3.8 s
  • rebase one commit across 1,354 new ones: clean, 1.9 s
  • thin pack for the push: 698 bytes
  • lefthook and RuboCop: the skill runs neither locally
  • push: not run

Run while the backend was not shedding.

Edited by Andrew Dunn

Merge request reports

Loading
Loading