Repository navigation
Don't scan from stale history before a kept clone fetches - #256
Merged
MHohlios merged 2 commits intoNov 2, 2026
Merged
Conversation
MHohlios
force-pushed
the
wiffletree/don-t-scan-from-stale-history-before-a-kept-clon
branch
from
November 2, 2026 21:04
9bd9f8d to
2a218e5
Compare
added 2 commits
November 2, 2026 16:11
A kept clone's first pull scan could run before its first fetch, when the mark it joined at is not in the clone yet. The scan then moved the mark back to the clone's old head, and the next pull rescanned commits pushed while the Mac was away. A mark the clone does not have now waits.
A kept clone rejoining a Space now fetches the head it joined at from the staging clone, so its pull scan's mark is always a commit it has. The scan waits while the head is at or behind the mark, instead of waiting on a missing mark, which a rewrite before the first pull left missing for good.
MHohlios
force-pushed
the
wiffletree/don-t-scan-from-stale-history-before-a-kept-clon
branch
from
November 2, 2026 21:21
2a218e5 to
57a01bf
Compare
MHohlios
deleted the
wiffletree/don-t-scan-from-stale-history-before-a-kept-clon
branch
November 2, 2026 21:45
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.
When a Mac rejoins a Space with a kept storage clone, its scan marks start at the join head, which the kept clone had not fetched yet. A pull scan before the first fetch fell back to the clone's old head and moved the mark back there, so the next pull rescanned everything pushed while the Mac was away and raised alerts for old commits.
place_storage(storage.rs): when the clone is kept, it fetches the staging clone's HEAD (the join head) before the staging clone is dropped. A local fetch, no network.advance(alerts.rs): the scan waits only while the clone's head is at or behind the mark, which is the case before the first fetch. After a rewrite, the merge-base restart runs as before, and a mark that is ever missing restarts at the head, so the scan never stalls.Trade-off: if
mainis reset to an ancestor and nothing new is pushed, open alerts are re-checked only when the next commit arrives. Nothing goes unscanned.A follow-up to #235.
Tests:
a_kept_clones_first_scan_waits_for_its_fetch_and_scans_no_old_history: the mark waits and no old commit raises an alert; before the fix the mark moved back and the next pull raised a phone alert.a_rewrite_before_a_kept_clones_first_fetch_scans_what_follows: rejoin, rewritemain, push a phone number, pull; one alert for the new commit only. A first version of this fix stalled here with no alert.Reviewed with Wiffletree: 1 full review and 0 re-checks, 2 rounds (Tests, Claude, Style)