Repository navigation
git: a git repository as a storage backend - #49
Merged
Merged
Conversation
GitBackend is one branch of a bare repository, written through its own staging index with git plumbing (no work tree, no user configuration, no hooks). Writes stage; checkpoint() records the staged tree as a commit and moves the branch atomically, fsynced, which is the durability point. Identical content is stored once and packed with deltas: forty revisions of one document pack to under two copies. It reads and lists like a filesystem (load, list_files, list_dir, is_file, is_dir, move, copy, delete), reads any past checkpoint (ref=), and adds what versioned content needs: history (per path), restore (a return to a past tree is a new commit), fork, and blob_id/tree_id, which name content so anything derived from it can be validated by id. A checkpoint moves the branch only from the head the instance started from, so a second writer's commit is a raised conflict, never a lost update. Backends that need application context to construct now declare it (requires_context) on the class; create_storage_registry asks the class, replacing its hand-kept list of names. Tests: 620 passed (13 new). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSmfWxP4Wnm2cFnvSCk
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.
GitBackend: one branch of a bare git repository as a Polystore backend, through git plumbing only.checkpoint(message)records the staged tree as a commit and moves the branch atomically (fsynced).history,restore,fork, reads at any past checkpoint (ref=), andblob_id/tree_idcontent ids for validating anything derived from stored content.requires_contexton the class;create_storage_registryasks the class instead of a list of names.Tests: 620 passed, 5 skipped (13 new in tests/test_git_backend.py).
🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSmfWxP4Wnm2cFnvSCk