Skip to content

Walk v2 snapshot history via repo file parent offsets - #28

Merged
Shane98c merged 2 commits into
mainfrom
v2-walk-history
Oct 16, 2026
Merged

Shane98c merged 2 commits into
mainfrom
v2-walk-history

Conversation

@Shane98c

Copy link
Copy Markdown
Collaborator

walkHistory stopped after the head snapshot on v2 repos. v2 snapshot files don't store a parent: that information lives only in the repo file as parent_offset. The walk now finds each parent there.

  • v1 repos behave the same as before.
  • If a snapshot isn't in the repo file, the walk throws instead of quietly stopping early.
  • Corrupt offsets are rejected, and cycles in the history throw instead of looping forever.

Tests cover main and feature-branch histories plus the error cases.

v2 snapshot files carry no parent pointer, so walkHistory stopped after
the head snapshot on every v2 repo. Resolve parents from the repo file's
parent_offset indices, reloading the repo info once when a snapshot is
newer than the cached copy. Reject corrupt offsets and cyclic ancestry.
A snapshot absent from the cached repo info now throws rather than
triggering a refetch, keeping the Repository's view fixed at open.
@Shane98c
Shane98c merged commit f943834 into main Oct 16, 2026
12 checks passed
@Shane98c
Shane98c deleted the v2-walk-history branch October 16, 2026 15:47
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