Skip to content

fix(topic): join and leave run post_sync - #10

Merged
antonzherdev merged 1 commit into
mainfrom
antonzherdev/topic-join-post-sync
Oct 27, 2026
Merged

antonzherdev merged 1 commit into
mainfrom
antonzherdev/topic-join-post-sync

Conversation

@antonzherdev

Copy link
Copy Markdown
Collaborator

post_sync is documented to run at the end of every placement, and git topic join and leave place a checkout, but neither ran it: join_or_leave places through the Placer directly rather than through sync::place, which is where the hook lives. So whatever post_sync sets up for the workspace's checkouts (installing, generating, listing them) missed the checkout that had just been joined, until the next sync.

Now join_or_leave runs post_sync once at the end, when at least one named checkout was joined or left and none failed. A failed join runs nothing, matching sync. --dependants with nothing to join runs nothing either.

  • src/commands/topic.rs: the call, after the failure check.
  • docs/hooks.md: git topic join and leave added to the placements that run it.
  • tests/it/topic.rs: normal_067_join_and_leave_run_post_sync counts the runs across a join, a leave and a failed join. It fails without the fix (left: 1, right: 2 on the join).

Tests: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, and cargo test --locked (655 integration and 172 unit tests pass). Run from a checkout nested inside another gitscale workspace, five "outside a workspace" tests fail because the playground under CARGO_MANIFEST_DIR finds the outer workspace; that's independent of this change, and they pass from a standalone copy.

https://claude.ai/code/session_01Q7zEtUTmJTS7ehno23nEG6

🤖 Generated with Claude Code

A join or leave places a checkout, and the docs say post_sync runs at the end
of every placement, but join_or_leave placed through the Placer directly and
never ran it. Whatever post_sync sets up for the workspace's checkouts missed
the one that had just been joined. It now runs once a join or leave succeeds
for every named checkout, and not when one fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q7zEtUTmJTS7ehno23nEG6
@antonzherdev
antonzherdev merged commit c80cfd5 into main Oct 27, 2026
1 check passed
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