Skip to content

[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs - #77

Open
friel-openai wants to merge 1 commit into
codexfrom
dev/friel/defer-packfile-uri-fsck
Open

[PATCH] fetch-pack: defer .gitattributes checks for packfile URIs#77
friel-openai wants to merge 1 commit into
codexfrom
dev/friel/defer-packfile-uri-fsck

Conversation

@friel-openai

@friel-openai friel-openai commented Aug 29, 2026

Copy link
Copy Markdown

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(-)

@friel-openai friel-openai added the git Changes to the Git project label Aug 29, 2026 — with ChatGPT Codex Connector
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>
@friel-openai
friel-openai force-pushed the dev/friel/defer-packfile-uri-fsck branch from 9901b53 to d20dd4f Compare August 29, 2026 23:22
@friel-openai
friel-openai marked this pull request as ready for review August 30, 2026 00:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T00:16:57.094164Z d20dd4f Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread fetch-pack.c
Comment on lines +1881 to +1882
fsck_options_init(&fsck_options, the_repository,
FSCK_OPTIONS_MISSING_GITMODULES_AND_GITATTRIBUTES);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@friel-openai friel-openai changed the title fetch-pack: defer .gitattributes checks for packfile URIs [PATCH] fetch-pack: defer .gitattributes checks for packfile URIs Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

git Changes to the Git project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant