From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] t7700: add tests for `--keep-unreachable`
Date: Mon, 03 Feb 2025 09:13:42 -0800 [thread overview]
Message-ID: <xmqqy0yn0x4p.fsf@gitster.g> (raw)
In-Reply-To: <20250203-b4-pks-repack-unreachable-objects-wo-packfiles-v1-1-7c4d69c5072c@pks.im> (Patrick Steinhardt's message of "Mon, 03 Feb 2025 14:06:54 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> +expect_object_count () {
> + find .git/objects \( -type d \( -name pack -o -name info \) -prune \) -o -type f -print >objects &&
> + test_line_count = "$1" objects
> +}
So this is counting "loose" objects. Do we want to have "loose"
somewhere in its name?
> +expect_object_in_idx () {
> + git verify-pack -v "$1" >objects &&
> + test_grep "^$2" objects
> +}
And this one checks if an object exists in a given pack in somewhat
an expensive way. It can take either .idx or .pack but the name
makes the caller assume it should be called with .idx, which is OK.
Would it achieve the same effect and be faster to do something like
git show-index <"$1" >objects &&
test_grep "^[0-9]* $2 (" objects
instead?
Thanks.
next prev parent reply other threads:[~2025-02-03 17:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 13:06 [PATCH 0/2] builtin/repack: fix `--keep-unreachable` when there are no packs Patrick Steinhardt
2025-02-03 13:06 ` [PATCH 1/2] t7700: add tests for `--keep-unreachable` Patrick Steinhardt
2025-02-03 17:13 ` Junio C Hamano [this message]
2025-02-03 18:32 ` Jeff King
2025-02-03 23:53 ` Junio C Hamano
2025-02-04 2:35 ` Jeff King
2025-02-04 7:00 ` Patrick Steinhardt
2025-02-03 13:06 ` [PATCH 2/2] builtin/repack: fix `--keep-unreachable` when there are no packs Patrick Steinhardt
2025-02-04 3:01 ` Jeff King
2025-02-04 7:01 ` Patrick Steinhardt
2025-02-04 14:58 ` Jeff King
2025-02-04 13:28 ` Junio C Hamano
2025-02-04 7:00 ` [PATCH v2] " Patrick Steinhardt
2025-02-04 15:22 ` Jeff King
2025-02-05 5:36 ` 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=xmqqy0yn0x4p.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/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).