Skip to content

Add read-only GitBlobstore#10409

Merged
coffeegoddd merged 21 commits intomainfrom
db/gitblobstore
Feb 4, 2026
Merged

Add read-only GitBlobstore#10409
coffeegoddd merged 21 commits intomainfrom
db/gitblobstore

Conversation

@coffeegoddd
Copy link
Copy Markdown
Contributor

This PR introduces an initial read-only GitBlobstore implementation to enable treating a git object database (bare repo / .git dir) as a Dolt blobstore, without a checkout.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a read-only Git-backed Blobstore implementation (GitBlobstore) plus supporting git plumbing helpers and test utilities, allowing Dolt to treat a bare git repo / .git directory as a blobstore without requiring a working tree checkout.

Changes:

  • Add GitBlobstore (go/store/blobstore/git_blobstore.go) implementing read-only Blobstore operations on top of git objects and refs, including key normalization and BlobRange handling.
  • Introduce internal git plumbing utilities (go/store/blobstore/internal/git/*) and a test helper package (go/store/testutils/gitrepo) for creating and seeding bare git repositories via the git CLI.
  • Add targeted tests for GitBlobstore semantics and an NBS smoke test that exercises manifest and table-like read patterns against a git-backed blobstore, plus design and agent instruction docs and minor tooling / repo config updates.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
go/utils/repofmt/format_repo.sh Updates deprecated egrep usage to grep -Ec when scanning imports, keeping the formatting helper script current.
go/store/testutils/gitrepo/gitrepo.go Adds a small helper API for creating bare git repos and setting refs to synthetic trees using git plumbing commands for tests.
go/store/testutils/gitrepo/gitrepo_test.go Verifies that InitBare and SetRefToTree correctly create a bare repo, write a commit, update a ref, and that expected paths exist.
go/store/nbs/git_blobstore_read_smoke_test.go Adds an NBS-level smoke test that seeds a git-backed manifest and “table” blob, then reads them through GitBlobstore via existing NBS manifest and table reader code paths.
go/store/blobstore/internal/git/write.go Defines a write-path WriteAPI interface and an UnimplementedWriteAPI implementation that consistently returns ErrUnimplemented for the current read-only milestone.
go/store/blobstore/internal/git/runner.go Implements a reusable Runner abstraction for invoking git plumbing commands with controlled environment, IO, and structured error reporting (CmdError); one documentation nit was noted where the Start comment does not fully match the behavior of the wrapped ReadCloser.
go/store/blobstore/internal/git/read.go Provides read-path helpers on top of Runner (TryResolveRefCommit, ResolvePathBlob, BlobSize, BlobReader, error normalization, etc.) used by GitBlobstore to resolve refs, paths, and stream blobs.
go/store/blobstore/internal/git/errors.go Introduces shared error types and helpers (ErrUnimplemented, RefNotFoundError, PathNotFoundError, NotBlobError, and predicates) to standardize git-plumbing error handling.
go/store/blobstore/git_blobstore.go Adds GitBlobstore, a read-only Blobstore implementation that maps keys to git tree paths under a ref (e.g. refs/dolt/data), with key normalization, missing-ref/key handling, and BlobRange slicing implemented on streamed git blob content.
go/store/blobstore/git_blobstore_test.go Adds focused unit tests validating GitBlobstore behavior for missing refs, existence and full reads, NotFound semantics, BlobRange correctness (including negative offsets), and invalid key rejection.
GITBLOBSTORE_DESIGN.md Documents the overall design of GitBlobstore, including versioning via commit hashes, CAS semantics, git plumbing usage, key validation rules, and how it integrates with existing NBS expectations.
AGENTS.md Adds contributor agent instructions for using the bd (beads) tool and required workflow steps when ending a work session.
.gitignore Extends ignore rules to cover .dir-locals.el, .beads, and .gitattributes, aligning local tooling and metadata with repo hygiene.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coffeegoddd
Copy link
Copy Markdown
Contributor Author

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
a7fa1f6 ok 5937471
version total_tests
a7fa1f6 5937471
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor Author

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
7be982d ok 5937471
version total_tests
7be982d 5937471
correctness_percentage
100.0

Copy link
Copy Markdown
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments. All looks pretty good so far to me!

@coffeegoddd
Copy link
Copy Markdown
Contributor Author

@coffeegoddd DOLT

comparing_percentages
100.000000 to 100.000000
version result total
83a31e2 ok 5937471
version total_tests
83a31e2 5937471
correctness_percentage
100.0

@coffeegoddd coffeegoddd merged commit 18d18c1 into main Feb 4, 2026
28 of 29 checks passed
@coffeegoddd coffeegoddd deleted the db/gitblobstore branch February 4, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants