[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs - #77
[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs#77friel-openai wants to merge 9 commits into
Conversation
Integrate the current tb/codex/automation topic into the internally distributed codex branch. Codex-Integration: tb/codex/automation@9b7652c87e369dafb6a50e97d24670ccd512f1bc
Integrate the current tb/codex/geometric-maintenance-promisor topic into the internally distributed codex branch. Codex-Integration: tb/codex/geometric-maintenance-promisor@bccc1fd882f27143f7331192a75c6281ba76e2f7
Integrate the current tb/codex/release topic into the internally distributed codex branch. Codex-Integration: tb/codex/release@2bb6c1c18aa3170efff362eb3fb8f096134955f7
Integrate the current dr/codex/dugite topic into the internally distributed codex branch. Codex-Integration: dr/codex/dugite@5b75aebc9071c08a87ddf7bf00b173e05a5bfc96
Integrate the current tb/codex/lto-pgo topic into the internally distributed codex branch. Codex-Integration: tb/codex/lto-pgo@67ba20645b1792f43c8c8ea69c716687bda87ec3
Integrate the current tb/codex/packfile-uri-concurrency topic into the internally distributed codex branch. Codex-Integration: tb/codex/packfile-uri-concurrency@2c3adbb2c475981e340c79fdc5e7f4f9b5d9054e
Integrate the current af/codex/pack-bytes topic into the internally distributed codex branch. Codex-Integration: af/codex/pack-bytes@a6bb1bb89133e5eccf6e3ca3aaa58f560eb3744c
Integrate the current tb/codex/parallel-packfile-uris topic into the internally distributed codex branch. Codex-Integration: tb/codex/parallel-packfile-uris@6f0edce407d5e8c1d212514281f49c9bc433ee3c
With fetch.fsckObjects or transfer.fsckObjects enabled, index-pack checks each pack as soon as it has been installed. Some checks need objects from another pack, though. A tree in the inline pack can name a .gitattributes blob that arrives in a packfile URI response. index-pack then reports the missing blob before fetch-pack has downloaded the URI pack. The same split already works for .gitmodules. index-pack writes any unresolved .gitmodules object IDs after its pack result. fetch-pack collects those IDs and runs fsck_finish() after all packs have been installed. Extend that handoff to .gitattributes. Prefix .gitattributes records so fetch-pack can distinguish them while leaving the existing .gitmodules output unchanged. The existing fsck_finish() call then checks both sets after every packfile URI has been indexed. Test that two concurrently indexed URI packs accept a valid split .gitattributes file and reject an overlong one. Signed-off-by: Friel <friel@openai.com>
9901b53 to
d20dd4f
Compare
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d20dd4fd44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fsck_options_init(&fsck_options, the_repository, | ||
| FSCK_OPTIONS_MISSING_GITMODULES_AND_GITATTRIBUTES); |
There was a problem hiding this comment.
Apply fetch fsck overrides to deferred attribute checks
When packfile URIs split a .gitattributes blob from its tree, the final fsck_finish() uses this strictly initialized options object without applying fsck_msg_types. Consequently settings such as fetch.fsck.gitattributesLineLength=ignore and fetch.fsck.skipList are ignored for the newly deferred check, so a fetch configured to tolerate or skip that object still fails with fsck failed; populate these options from the fetch fsck configuration before accumulating deferred IDs.
Useful? React with 👍 / 👎.
With fetch.fsckObjects or transfer.fsckObjects enabled, index-pack checks
each pack as soon as it has been installed. Some checks need objects from
another pack, though. A tree in the inline pack can name a .gitattributes
blob that arrives in a packfile URI response. index-pack then reports the
missing blob before fetch-pack has downloaded the URI pack.
The same split already works for .gitmodules. index-pack writes any
unresolved .gitmodules object IDs after its pack result. fetch-pack
collects those IDs and runs fsck_finish() after all packs have been
installed.
Extend that handoff to .gitattributes. Prefix .gitattributes records so
fetch-pack can distinguish them while leaving the existing .gitmodules
output unchanged. The existing fsck_finish() call then checks both sets
after every packfile URI has been indexed.
Test that two concurrently indexed URI packs accept a valid split
.gitattributes file and reject an overlong one.
Signed-off-by: Friel friel@openai.com
Documentation/git-index-pack.adoc | 8 +++---
builtin/index-pack.c | 3 ++-
fetch-pack.c | 57 ++++++++++++++++++++++-----------------
fsck.c | 23 +++++++++-------
fsck.h | 11 ++++----
t/t5702-protocol-v2.sh | 45 +++++++++++++++++++++++++++++++
6 files changed, 103 insertions(+), 44 deletions(-)