[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs - #77
[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs#77friel-openai wants to merge 1 commit into
Conversation
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(-)