From d69e4d4ba0b6aa1e64b5885732c181434c264d60 Mon Sep 17 00:00:00 2001 From: "yuito.watanabe" <72675978+wwwyo@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:38:31 +0900 Subject: [PATCH 1/2] fix(update): skip negotiation when fetching upstream history blobs GitHub omits wanted blobs that are reachable from the commits the client advertises as haves, so the batch fetch failed with "did not send all necessary objects" whenever a base file was unchanged at the upstream tip. Use the noop negotiator, as Git's own promisor fetch does. Claude-Session: https://claude.ai/code/session_01EUgMLcfukUoucoQ5DWyw4u --- internal/upstream/history.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/upstream/history.go b/internal/upstream/history.go index d722250..a02d94a 100644 --- a/internal/upstream/history.go +++ b/internal/upstream/history.go @@ -83,7 +83,10 @@ func historyOriginal(request ExportRequest) (map[string]file, error) { } if wants.Len() > 0 { env := removeEnv(gitx.Environment("GIT_TERMINAL_PROMPT=0"), "OPENCODE_API_KEY") - if _, err := gitx.SafeStdinEnv(directory, env, []byte(wants.String()), "fetch", "--quiet", "--no-tags", "--no-write-fetch-head", "--filter=blob:none", "--stdin", "origin"); err != nil { + // Like Git's own promisor fetch, skip negotiation: advertising the fetched + // commits as haves lets GitHub omit blobs that are still reachable from them. + if _, err := gitx.SafeStdinEnv(directory, env, []byte(wants.String()), "-c", "fetch.negotiationAlgorithm=noop", + "fetch", "--quiet", "--no-tags", "--no-write-fetch-head", "--filter=blob:none", "--stdin", "origin"); err != nil { return nil, fmt.Errorf("cannot fetch registered original blobs from upstream history") } } From 6ab8b17078a5650388ce1f7910aaefea83dfd1e3 Mon Sep 17 00:00:00 2001 From: "yuito.watanabe" <72675978+wwwyo@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:44:26 +0900 Subject: [PATCH 2/2] docs(update): clarify the noop negotiation comment Claude-Session: https://claude.ai/code/session_01EUgMLcfukUoucoQ5DWyw4u --- internal/upstream/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/upstream/history.go b/internal/upstream/history.go index a02d94a..83270c6 100644 --- a/internal/upstream/history.go +++ b/internal/upstream/history.go @@ -83,8 +83,8 @@ func historyOriginal(request ExportRequest) (map[string]file, error) { } if wants.Len() > 0 { env := removeEnv(gitx.Environment("GIT_TERMINAL_PROMPT=0"), "OPENCODE_API_KEY") - // Like Git's own promisor fetch, skip negotiation: advertising the fetched - // commits as haves lets GitHub omit blobs that are still reachable from them. + // Skip negotiation, as Git's own promisor fetch does, so local commits are not + // advertised as haves; GitHub otherwise omits requested blobs reachable from them. if _, err := gitx.SafeStdinEnv(directory, env, []byte(wants.String()), "-c", "fetch.negotiationAlgorithm=noop", "fetch", "--quiet", "--no-tags", "--no-write-fetch-head", "--filter=blob:none", "--stdin", "origin"); err != nil { return nil, fmt.Errorf("cannot fetch registered original blobs from upstream history")