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

Re: [PATCH 1/2] t7700: add tests for `--keep-unreachable`

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2025, 17:13 UTC
Message-ID
<xmqqy0yn0x4p.fsf@gitster.g>
In-Reply-To
<20250203-b4-pks-repack-unreachable-objects-wo-packfiles-v1-1-7c4d69c5072c@pks.im>
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.
Previous: Patrick SteinhardtNext: Jeff King
Message 8 of 15 in “builtin/repack: fix `--keep-unreachable` when there are no packs”
  1. 0/2 builtin/repack: fix `--keep-unreachable` when there are no packsPatrick Steinhardt, Feb 3, 2025
  2. 2/2 builtin/repack: fix `--keep-unreachable` when there are no packsPatrick Steinhardt, Feb 3, 2025
  3. Jeff KingFeb 4, 2025
  4. Patrick SteinhardtFeb 4, 2025
  5. Jeff KingFeb 4, 2025
  6. Junio C HamanoFeb 4, 2025
  7. 1/2 t7700: add tests for `--keep-unreachable`Patrick Steinhardt, Feb 3, 2025
  8. Junio C HamanoFeb 3, 2025
  9. Jeff KingFeb 3, 2025
  10. Junio C HamanoFeb 3, 2025
  11. Jeff KingFeb 4, 2025
  12. Patrick SteinhardtFeb 4, 2025
  13. builtin/repack: fix `--keep-unreachable` when there are no packsPatrick Steinhardt, Feb 4, 2025
  14. Jeff KingFeb 4, 2025
  15. Patrick SteinhardtFeb 5, 2025

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.