Skip to content

Build the session's own checkout in the Stop hook - #238

Merged
wr merged 1 commit into
mainfrom
wells/stop-hook-build-session-checkout
Oct 6, 2026
Merged

wr merged 1 commit into
mainfrom
wells/stop-hook-build-session-checkout

Conversation

@wr

@wr wr commented Oct 6, 2026

Copy link
Copy Markdown
Owner

The Stop hook rebuilt Mojito Dev from a relative Mojito.xcodeproj, which resolved to the main checkout. A session working in a worktree had its fresh build replaced at the end of every turn by whatever branch the main checkout had checked out. During W-990 that put the still-broken picker back into /Applications after each turn.

The hook now runs cd "$(jq -r .cwd)" first, using the session's working directory from the hook's stdin JSON, so it builds the checkout the session is actually in.

Test plan

  • jq resolves .hooks.Stop[].hooks[].command in the edited file
  • After merging, end a turn in a worktree session and confirm /tmp/mojito-build.log shows that worktree's path

The hook ran xcodebuild against a relative project path from the main
checkout, so a session working in a worktree got its build replaced at
the end of every turn by whatever branch the main checkout had out.
It now changes into the session's cwd from the hook input first.
@wr
wr merged commit 61500ec into main Oct 6, 2026
3 checks passed
@wr
wr deleted the wells/stop-hook-build-session-checkout branch October 6, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant