Repository navigation
Keep the history of existing clones when old commits are deleted - #6
Merged
Kaliumhexacyanoferrat merged 1 commit intoOct 5, 2026
Merged
Conversation
A repository whose oldest commits were deleted announced the oldest
remaining commit as a shallow boundary to every client - also to a clone
made before, which still has the deleted parents. Git refuses to update
a complete clone to commits behind a shallow root ("shallow roots are not
allowed to be updated"), so such a clone could not fetch anything newer.
The commits the history refers to but no longer has are now known by
their ids: a client that has one is acknowledged as having it, and a
commit based on it is no shallow boundary for that client.
Bumps the version to 0.1.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kaliumhexacyanoferrat
deleted the
fix/shallow-history-of-existing-clones
branch
October 5, 2026 08:54
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.
A repository whose oldest commits were deleted (retention, see Truncated histories) announced the oldest remaining commit as a shallow boundary to every client - also to a clone made before the deletion, which still has the deleted parents. Git refuses to update a complete clone to commits behind a shallow root:
so such a clone could not fetch anything newer, contrary to what the docs promise ("Clients that already have older commits keep them").
The fix: the commits the history refers to but no longer has - the missing parents of the oldest remaining commits, found by walking the newest 10,000 commits from the references - are now known by their ids. A client that says it has one is acknowledged as having it (so it keeps sending it for the rest of the stateless negotiation), and a commit based on it is no shallow boundary for that client. Fresh clones still get a shallow history.
RepositoryContext.GetTruncatedAsync()collects those ids, once per requestFetchPlanner.FindCommonAsyncacknowledges them,GetOwnedAsynccounts them as owned, andPlanAsyncleaves out the shallow line where the client has the historyTestRetentionKeepsTheHistoryOfExistingClones(protocol 0 and 2): a clone made before versions were deleted pulls the newer ones, stays complete and passesgit fsck --strict; a new clone is shallowFound while building git access for GenHTTP Lambda, which prunes old versions per tier.
🤖 Generated with Claude Code