Skip to content

Prevent :@@= loads from (falsely) indicating to the server they have missing commit ancestry - #260

Merged
nishu-builder merged 1 commit into
mainfrom
codex/publish-git-compat-20260917-911f8bae
Sep 18, 2026
Merged

nishu-builder merged 1 commit into
mainfrom
codex/publish-git-compat-20260917-911f8bae

Conversation

@nishu-builder

@nishu-builder nishu-builder commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

The problem:

  1. :@@= shallow-fetches commit C. Git writes C’s hash into .git/shallow.
  2. CAOS extracts C’s tree and includes it in a request tree R. R does not need to reference commit C.
  3. Later, CAOS runs git push to upload R. Git sends roughly:
   shallow <C's hash>
   <command to update refs/caos/req/R>
   <pack containing R and the objects it needs>

Git announces the local shallow boundaries even when those commits aren’t part of what’s being pushed. Our server rejects the request as soon as it sees shallow C. It doesn’t first establish whether C is relevant to this upload.

This PR keeps the cleanup on the client. It shallow-fetches into a temporary bare repository, copies only the snapshot’s trees and blobs into the client’s object store, then deletes the temporary repository, including the fetched commit and .git/shallow. The server continues rejecting shallow pushes; it does not strip anything from the request.

A ref under refs/caos/locator-trees/<commit> remembers the tree hash and keeps the snapshot available for reuse. import_source continues to import full commit history.

@nishu-builder
nishu-builder added this pull request to stack #261 September 18, 2026 10:53
@nishu-builder nishu-builder changed the title Keep snapshot fetches from making client repositories shallow Prevent :@@= loads from (falsely) indicating to the server they have missing commit ancestry Sep 18, 2026
@nishu-builder
nishu-builder merged commit 3625b16 into main Sep 18, 2026
2 checks 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