Skip to content

feat(git): support commit-set in /ensure-refs#305

Merged
alecthomas merged 1 commit into
mainfrom
ensure-refs-commits
May 14, 2026
Merged

feat(git): support commit-set in /ensure-refs#305
alecthomas merged 1 commit into
mainfrom
ensure-refs-commits

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

EnsureRefs previously only accepted a refs map and required keys to be ref names. To pre-warm individual commits (e.g. a PR head SHA that may not yet point at any named ref), callers had to construct a fake ref. Extend the request to accept an explicit commits list.

The endpoint now accepts {"refs":..., "commits":[...]}, with at least one populated. The server fetches once if any ref is wrong or any commit is missing from the local object database, then reports resolved ref SHAs and any commits still missing after the fetch.

The client API takes an EnsureGitRefsRequest struct so the field set can grow without further breaking changes. cachew git restore gains a --commit flag (repeatable) and treats the local short-circuit symmetrically across refs and commits; a server response with missing_commits is fatal.

EnsureRefs previously only accepted a refs map and required keys to be ref names. To pre-warm individual commits (e.g. a PR head SHA that may not yet point at any named ref), callers had to construct a fake ref. Extend the request to accept an explicit commits list.

The endpoint now accepts {"refs":..., "commits":[...]}, with at least one populated. The server fetches once if any ref is wrong or any commit is missing from the local object database, then reports resolved ref SHAs and any commits still missing after the fetch.

The client API takes an EnsureGitRefsRequest struct so the field set can grow without further breaking changes. cachew git restore gains a --commit flag (repeatable) and treats the local short-circuit symmetrically across refs and commits; a server response with missing_commits is fatal.
@alecthomas alecthomas requested a review from a team as a code owner May 14, 2026 05:59
@alecthomas alecthomas requested review from jrobotham-square and removed request for a team May 14, 2026 05:59
@alecthomas alecthomas merged commit caeeee2 into main May 14, 2026
8 checks passed
@alecthomas alecthomas deleted the ensure-refs-commits branch May 14, 2026 06:05
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