Repository navigation
perf(topic): join and leave ask no other lazy remote; finish fetches a store once - #11
Merged
Merged
Conversation
antonzherdev
changed the base branch from
antonzherdev/plat-1034-gitscale-skip-the-remote-topic-probe-on-a-fresh-topic-start
to
main
October 28, 2026 04:26
antonzherdev
force-pushed
the
topic-scoped-network
branch
from
October 28, 2026 04:26
70f5fa3 to
db13ba9
Compare
…a store once `git topic join` and `leave` resolved the workspace online, which asks every lazy repository's remote for the topic's branch, though they place only the checkouts they name. Each question is a round trip, and on a workspace with many lazy entries those were most of every join. They now resolve with Network::Scoped, which `start` already used under the name NewTopic: the stores read are fetched as online, but no lazy remote is asked. A named lazy entry is woken before resolution, so the one joined still finds the branch its remote has. `finish` fetched each store on the topic twice: once to decide whether its child had settled, once before deleting its remote branch. A store is now fetched once per finish, and the second check reads what the first fetched. On a workspace of 45 lazy entries, 0.3 s from its server, a warm start, join and finish of one repository went from about 85 s to about 30 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q7zEtTAXBrRjmCYoNBKDLk
Network::Scoped answered "no" for every lazy repository's topic branch, knowing less than an offline placement, which reads what the store last fetched. With worktrees of one root sharing stores, that broke `topic join` of a lazy repository whose store had already fetched the topic's branch for another worktree: the first, on-miss resolution counted it awake and so did not name it, and the scoped one then left it out, so the join failed with "not a checkout of this workspace". It also kept such a repository out after `start`, and the next on-miss placement put it back. Scoped now reads the store's refs, as offline does, and still asks no remote. The docs say which stores join and leave fetch, and that finish does not retry a store fetch that failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q7zEtTAXBrRjmCYoNBKDLk
antonzherdev
force-pushed
the
topic-scoped-network
branch
from
October 28, 2026 05:02
9152fab to
e34c2c2
Compare
antonzherdev
marked this pull request as ready for review
October 28, 2026 05:08
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.
Follows #9, which stopped
topic startasking lazy remotes. This does the same for the other topic commands a short-lived task runs.What changes
joinandleavenow resolve withNetwork::Scoped(feat(topic): start asks no lazy remote for the new topic's branch #9'sNewTopic, renamed because it no longer serves onlystart). The stores they read are fetched as before, but no other lazy repository's remote is asked for the topic's branch. Both commands place only the checkouts they name. A named lazy entry is woken before resolution, so the joined repository still finds a branch its remote already has (feat(topic): start asks no lazy remote for the new topic's branch #9'sedge_029covers this).finishfetched each store on the topic twice: once inchildren_on_topic, and again before deciding which remote branches to delete. It now fetches each store once per finish (fetch_once), and a failure warns the same way at either step.Scopedreads the store. For a lazy repository's topic branch it reads what the store last fetched, as an offline placement does, instead of answering "no". Without this,joinfailed ("not a checkout of this workspace") for a lazy repository whose shared store had already fetched the topic's branch for another worktree of the root. It also fixes feat(topic): start asks no lazy remote for the new topic's branch #9'sstartleaving such a repository out until the next placement put it back.edge_032covers it.switchandgit scale syncstill ask every lazy remote.Measurements
On a workspace of 45 lazy entries, 0.3 s round trip from its git server, a warm start, join and finish of one small repository:
topic starttopic jointopic finish --forceTests
perf_030_join_and_leave_ask_no_other_lazy_remoteperf_031_finish_fetches_each_store_onceBoth fail without the change. #9's
perf_028now shares theirround_tripshelper, which countsgit-upload-packstarts in git's trace2 events.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q7zEtTAXBrRjmCYoNBKDLk