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
A hub worktree created anywhere can commit, with or without hub-private #386
A hub worktree outside hub-worktrees/, such as one in a temporary directory, cannot commit, and hub's checks fail there, so agent workflows that check or land work in a worktree made with mktemp -d stop on hub. In a fresh worktree the pre-commit cargo fmt --check fails with failed to resolve mod private: clients/src/private.rs does not exist, and the same for ui/tui and workflows, before hub-private is involved. After just setup-private links hub-private in, clippy fails reading prompts/investigations/media.md, which hub tracks as a relative link to ../../../hub-private/prompts/media-investigate.md, so it resolves only when the checkout's parent also holds hub-private. Worktrees under hub-worktrees/ work only because that folder holds an untracked hub-private -> ../hub-private link that no doc mentions (both seen 2026-10-28).
Ideal state
A hub worktree created anywhere commits and pushes without hub-private linked
After just setup-private, a hub worktree created anywhere commits and pushes in every configuration just lint checks
A fix for this should not make worktrees share the main checkout's target/ through CARGO_TARGET_DIR to skip the cold build. It lets one checkout run the other's code with no warning.
What I ran (2026-11-04, 57f71d6, --features private,hub-tui/media): a scratch worktree with a #[used] static holding a marker string that only the worktree's source had. I built it with CARGO_TARGET_DIR set to the main checkout's target/, then ran cargo build in the main checkout.
What I saw: the worktree build put the marker in target/debug/hub-tui. The main checkout's build then reported the package fresh and recompiled nothing. Its hub-tui binary still held the marker, although the main checkout's source has none. Both checkouts resolve the workspace packages to the same artifact hash (for example hub_tui-5ce22af363431038), so each accepts whatever the other built last. A just tui in either checkout can run the other checkout's code.
What a separate target/ costs instead, on an M2 with 8 cores: git worktree add 0.1s, a cold just build 19.1s and 1.1 GB, then 0.1s with no change and 2.3s after touching one leaf file. In a second worktree at e17d0db, starting cold: just setup-private home-laptop 8.0s, just test 23.5s to compile and 4.4s to run all 1,646 tests, then just lint across all three configurations 20.5s. A second just lint with no change took 0.8s. The worktree's target/ ended at 2.2 GB. So a worktree reaches hub's full checks in about a minute of cold work, which is cheap enough that sharing a target is not worth the risk.
Seen again 2026-11-05: a hub worktree made with mktemp -d could not build with hub-private linked until prompts/investigations/media.md was relinked to an absolute path. Since #401, AGENTS.md says a Dependabot PR that changes Cargo.toml or Cargo.lock merges only after just lint and just test pass with every hub-private module linked. Until this is fixed, each such PR (#406 to #410 so far) has to be checked in the main checkout or under hub-worktrees/.
Seen again on #410 (2026-11-08): hub's own PR worktrees, such as ~/.hub/repos/hub/pr-410, have no hub-private beside them either, so just lint failed in the "hub-private with media" configuration until a hub-private link was added next to the checkout.
Activity
ooloth commentedon Nov 5, 2026
A fix for this should not make worktrees share the main checkout's
target/throughCARGO_TARGET_DIRto skip the cold build. It lets one checkout run the other's code with no warning.What I ran (2026-11-04,
57f71d6,--features private,hub-tui/media): a scratch worktree with a#[used]static holding a marker string that only the worktree's source had. I built it withCARGO_TARGET_DIRset to the main checkout'starget/, then rancargo buildin the main checkout.What I saw: the worktree build put the marker in
target/debug/hub-tui. The main checkout's build then reported the package fresh and recompiled nothing. Itshub-tuibinary still held the marker, although the main checkout's source has none. Both checkouts resolve the workspace packages to the same artifact hash (for examplehub_tui-5ce22af363431038), so each accepts whatever the other built last. Ajust tuiin either checkout can run the other checkout's code.What a separate
target/costs instead, on an M2 with 8 cores:git worktree add0.1s, a coldjust build19.1s and 1.1 GB, then 0.1s with no change and 2.3s after touching one leaf file. In a second worktree ate17d0db, starting cold:just setup-private home-laptop8.0s,just test23.5s to compile and 4.4s to run all 1,646 tests, thenjust lintacross all three configurations 20.5s. A secondjust lintwith no change took 0.8s. The worktree'starget/ended at 2.2 GB. So a worktree reaches hub's full checks in about a minute of cold work, which is cheap enough that sharing a target is not worth the risk.ooloth commentedon Nov 5, 2026
Seen again 2026-11-05: a hub worktree made with
mktemp -dcould not build with hub-private linked untilprompts/investigations/media.mdwas relinked to an absolute path. Since #401,AGENTS.mdsays a Dependabot PR that changesCargo.tomlorCargo.lockmerges only afterjust lintandjust testpass with every hub-private module linked. Until this is fixed, each such PR (#406 to #410 so far) has to be checked in the main checkout or underhub-worktrees/.ooloth commentedon Nov 9, 2026
Seen again on #410 (2026-11-08): hub's own PR worktrees, such as
~/.hub/repos/hub/pr-410, have nohub-privatebeside them either, sojust lintfailed in the "hub-private with media" configuration until ahub-privatelink was added next to the checkout.