git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1] sha1-file: split OBJECT_INFO_FOR_PREFETCH

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
May 28, 2019, 15:19 UTC
Message-ID
<pull.228.git.gitgitgadget@gmail.com>

I found this interaction while testing the VFS for Git fork rebasing onto v2.22.0-rc1 [1]. It seems this new flag meant for partial clone prefetches interacts poorly with the read-object hook we use in our fork.

The issue is that OBJECT_INFO_FOR_PREFETCH has multiple bits on, so testing "flag & OBJECT_INFO_FOR_PREFETCH" can be true even if not all bits are on. My fix simply splits the new bit into a special flag while keeping OBJECT_INFO_FOR_PREFETCH as a union of flags.

Jury is out if this fixes our problem, but it definitely seems like a bug waiting to happen in Git, too.

Thanks, -Stolee
[1] https://github.com/microsoft/git/pull/140
Derrick Stolee (1):
  sha1-file: split OBJECT_INFO_FOR_PREFETCH
 object-store.h | 10 +++++++---
 sha1-file.c    |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)
base-commit: 0f4a4fb1c4239a2aa46343add84ad6f99f6f3aae
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-228%2Fderrickstolee%2Fobject-info-prefetch-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-228/derrickstolee/object-info-prefetch-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/228
-- 
gitgitgadget
Next: Derrick Stolee via GitGitGadget
Message 1 of 5 in “sha1-file: split OBJECT_INFO_FOR_PREFETCH”
  1. 0/1 sha1-file: split OBJECT_INFO_FOR_PREFETCHDerrick Stolee via GitGitGadget, May 28, 2019
  2. 1/1 sha1-file: split OBJECT_INFO_FOR_PREFETCHDerrick Stolee via GitGitGadget, May 28, 2019
  3. Junio C HamanoMay 28, 2019
  4. Jeff KingMay 28, 2019
  5. Derrick StoleeMay 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.