From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: christian.couder@gmail.com, gitster@pobox.com,
johannes.schindelin@gmx.de, johncai86@gmail.com,
jonathantanmy@google.com, karthik.188@gmail.com,
kristofferhaugsbakk@fastmail.com, me@ttaylorr.com,
newren@gmail.com, peff@peff.net, ps@pks.im,
Derrick Stolee <stolee@gmail.com>
Subject: [PATCH 0/3] [2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk'
Date: Wed, 20 Aug 2025 18:39:53 +0000 [thread overview]
Message-ID: <pull.1956.git.1755715196.gitgitgadget@gmail.com> (raw)
Now that the --path-walk feature for git repack is out in the wild and
getting more visibility than it did in the Git for Windows fork, the
following issue was brought to my attention:
Some folks would report missing objects after git repack -adf --path-walk!
It turns out that this snuck through the cracks because it was pretty
difficult to create a reproducing test case (patch 1) but it boils down to:
1. A path has exactly one version across all of the history being repacked.
2. That path is in the index.
3. The object at that path is not a loose object.
4. pack.useSparse=true in the config (this is the default)
It is also something where users don't necessarily notice the missing
objects until they fetch and a missing object is used as a delta base. Doing
normal checkouts doesn't cause changes to these files, so they are never
opened by Git. Users hitting this issue can usually recover using git fetch
--refetch to repopulate the missing objects from a remote (unless they never
had a remote at all).
Patch 2 introduces the fix for this issue, which is related to forgetting to
initialize a struct indicator when walking the pending objects.
When reflecting on the ways that I missed this when building the feature, I
think the core issue was an overreliance on using bare repos in testing. I
also think that the way that the UNINTERESTING object exploration was
implemented was particularly fragile to missing updates to the
initialization of the struct, so patch 3 adds a new initializer to reduce
duplicate code and to help avoid this mistake in the future.
Thanks, -Stolee
P.S. CC'ing all original reviewers of the series.
Derrick Stolee (3):
t7700: add failing --path-walk test
path-walk: fix setup of pending objects
path-walk: create initializer for path lists
path-walk.c | 55 +++++++++++++++++++++--------------------------
t/t7700-repack.sh | 43 ++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 30 deletions(-)
base-commit: c44beea485f0f2feaf460e2ac87fdd5608d63cf0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1956%2Fderrickstolee%2Fpath-walk-missing-objects-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1956/derrickstolee/path-walk-missing-objects-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1956
--
gitgitgadget
next reply other threads:[~2025-08-20 18:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 18:39 Derrick Stolee via GitGitGadget [this message]
2025-08-20 18:39 ` [PATCH 1/3] t7700: add failing --path-walk test Derrick Stolee via GitGitGadget
2025-08-21 8:00 ` Patrick Steinhardt
2025-08-21 12:42 ` Derrick Stolee
2025-08-21 16:22 ` Junio C Hamano
2025-08-21 23:21 ` Elijah Newren
2025-08-20 18:39 ` [PATCH 2/3] path-walk: fix setup of pending objects Derrick Stolee via GitGitGadget
2025-08-20 19:02 ` Junio C Hamano
2025-08-20 19:42 ` Derrick Stolee
2025-08-21 8:01 ` Patrick Steinhardt
2025-08-21 12:55 ` Derrick Stolee
2025-08-21 8:01 ` Patrick Steinhardt
2025-08-21 20:33 ` Derrick Stolee
2025-08-21 23:21 ` Elijah Newren
2025-08-20 18:39 ` [PATCH 3/3] path-walk: create initializer for path lists Derrick Stolee via GitGitGadget
2025-08-21 23:22 ` Elijah Newren
2025-08-25 12:49 ` [PATCH v2 0/2] [2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk' Derrick Stolee via GitGitGadget
2025-08-25 12:49 ` [PATCH v2 1/2] path-walk: fix setup of pending objects Derrick Stolee via GitGitGadget
2025-08-25 12:49 ` [PATCH v2 2/2] path-walk: create initializer for path lists Derrick Stolee via GitGitGadget
2025-08-26 15:03 ` [PATCH v2 0/2] [2.51.0 Bug] Missing singleton objects in 'git repack -adf --path-walk' Elijah Newren
2025-08-26 15:58 ` Junio C Hamano
2025-09-02 11:19 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1956.git.1755715196.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=johncai86@gmail.com \
--cc=jonathantanmy@google.com \
--cc=karthik.188@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=me@ttaylorr.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).