Repository navigation
fetch-pack: keep tracking refs consistent with wanted-refs - #155
Open
friel-openai wants to merge 2 commits into
Open
friel-openai wants to merge 2 commits into
friel-openai wants to merge 2 commits into
Conversation
A source-only fetch such as "git fetch origin main" can create separate ref entries for FETCH_HEAD and a configured remote-tracking destination. fetch_pack() deduplicates its sought array by source name. If a protocol-v2 wanted-refs response selects an object different from ls-refs, only the retained entry receives the selected object ID. The tracking entry keeps the discovery object ID. This can leave FETCH_HEAD and the tracking ref inconsistent after a successful fetch. If the selected ref has moved to divergent history and the discovery object is absent locally, connectivity checking can fail because it still includes the stale tracking entry. Retain the original sought pointers and copy each resolved source object's ID back to all entries after fetching. Keep one wire want per source name and preserve the independent local expected-old values used for ref transactions. Exercise source-only fetches, multiple destinations, multiple named refs, and a divergent selected tip that does not include the discovery object. Retain controls for an unmatched tracking mapping and disabled ref-in-want. Signed-off-by: Frielbot <[email protected]>
Use the three workflow blobs already admitted by the Codex controller so this topic can run CI under the repository's full-SHA action policy. Signed-off-by: Frielbot <[email protected]>
friel-openai
marked this pull request as ready for review
October 21, 2026 21:46
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
A source-only fetch such as
git fetch origin maincan leaveFETCH_HEADand its configured tracking ref at different commits when a protocol-v2wanted-refsresponse selects a different OID fromls-refs. A divergent selected tip can instead make the fetch fail connectivity checking because a stale tracking entry still requires the discovery object.fetch_pack()deduplicates separate ref entries by source name. Preserve the original pointers and propagate each returned source OID to every original entry after fetching, so all local destinations use the selected object. Keep one wire want per name and retain the independent expected-old values used by local ref transactions.The native
t5703regressions use the existing deterministic HTTP response-rewrite fixture and synthetic commits. They checkFETCH_HEAD, configured tracking refs, multiple destinations and named refs, and a divergent tip that omits the discovery object. Controls retain the intended behavior with no tracking mapping and withref-in-wantdisabled.Validation: the new regressions produce four failures before the source correction. With the correction, the
DEVELOPER=1build succeeds, all 33t5703, 86t5702, and 239t5510tests pass with HTTP tests enabled, andgit diff --checkpasses.The topic starts from public
masteratb8242b093d9e941a34460d715e3ce616a34ac3feand targetscodexfor review only. A separate commit retains the three exact CI workflow blobs already allowed by the controller; it changes no release workflow. Wire and repository formats are unchanged, so clients can be updated independently. Reverting restores the inconsistent tracking behavior.Standalone SHA-256 CI exposes the existing WebDAV and dumb-HTTP authentication failures:
t5540.18andt5550.15,.16, and.20. Those commands usegit-http-pushorwalker_fetch(), bypassingfetch_pack(), and their HTTP source and test files are unchanged from this topic's base. Thet5703regressions pass in the same job. The authentication corrections in #126 and #142 are already incodexand absent from the standalone topic's public-master ancestry.The standalone macOS Meson job also hits the existing
apply-one-time-script.shrace duringt5616: a nested promisor fetch receives HTTP 500 after the CGI helper checks for a script that another request then deletes. Apache records the missing script and an empty CGI response. The helper is unchanged by this PR, andindex-packfails insidedo_fetch_pack_v2()before the new OID propagation runs. Upstream commit 5945464690 fixes this same test-helper race with deterministic coverage; its backport is separate work.The CI-only combined candidate completed successfully: 45 jobs passed, two expected jobs were skipped, and none failed. It tests exact
codexcommit9fe64f46bdef176eabbc4e7f1f15c8e4f8dbc325with this correction. The source patch has the same stable patch ID as this PR. Candidate2a3ec67b2411602e01e022044048f7dd649c1ccaexcludes release and controller workflows and leaves this topic's ancestry intact. The SHA-256 job passest5540,t5550, andt5703; macOS Meson also passes. This validates the patch with existingcodexprerequisites. The standalone matrix retains the unrelated failures described above. Human review and normal controller staging remain required.-frielbot
Codex Task:
codex://threads/01a15f86-2ac2-72c0-9c64-f832655979c7