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

[PATCH v3 0/2] gc: let feature.experimental imply gc.cruftPacks

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 26, 2022, 21:32 UTC
Message-ID
<cover.1666819953.git.me@ttaylorr.com>
In-Reply-To
<cover.1666815209.git.me@ttaylorr.com>

This is a small reroll of an adopted version of Emily's series[1], which I saw while sifting through old mail in my inbox.

This is substantively unchanged from the previous round, save:
  - renaming the helper functions which assert and refute the existence
    of cruft packs, and
  - an additional test which ensures that we can opt out of cruft packs
    via config
A range-diff is included below for convenience.
Thanks in advance for your review.
[1]: https://lore.kernel.org/git/20220803205721.3686361-1-emilyshaffer@google.com/
Emily Shaffer (2):
  gc: add tests for --cruft and friends
  config: let feature.experimental imply gc.cruftPacks=true
 Documentation/config/feature.txt |  3 +
 builtin/gc.c                     |  7 ++-
 repo-settings.c                  |  1 +
 repository.h                     |  1 +
 t/t6500-gc.sh                    | 96 ++++++++++++++++++++++++++++++++
 5 files changed, 106 insertions(+), 2 deletions(-)
Range-diff against v2:
1:  35d2c97715 ! 1:  e8726f3de7 gc: add tests for --cruft and friends
    @@ t/t6500-gc.sh: test_expect_success 'one of gc.reflogExpire{Unreachable,}=never d
     +	git reset HEAD^^
     +}
     +
    -+assert_cruft_pack_exists () {
    ++assert_cruft_packs () {
     +	find .git/objects/pack -name "*.mtimes" >mtimes &&
     +	sed -e 's/\.mtimes$/\.pack/g' mtimes >packs &&
     +
    @@ t/t6500-gc.sh: test_expect_success 'one of gc.reflogExpire{Unreachable,}=never d
     +
     +		prepare_cruft_history &&
     +		git gc --cruft &&
    -+		assert_cruft_pack_exists
    ++		assert_cruft_packs
     +	)
     +'
     +
    @@ t/t6500-gc.sh: test_expect_success 'one of gc.reflogExpire{Unreachable,}=never d
     +
     +		prepare_cruft_history &&
     +		git -c gc.cruftPacks=true gc &&
    -+		assert_cruft_pack_exists
    ++		assert_cruft_packs
     +	)
     +'
     +
2:  eb151752b8 ! 2:  13a25a425b config: let feature.experimental imply gc.cruftPacks=true
    @@ repository.h: struct repo_settings {
      	int sparse_index;
     
      ## t/t6500-gc.sh ##
    -@@ t/t6500-gc.sh: assert_cruft_pack_exists () {
    +@@ t/t6500-gc.sh: assert_cruft_packs () {
      	done <packs
      }
      
    -+refute_cruft_packs_exist () {
    ++assert_no_cruft_packs () {
     +	find .git/objects/pack -name "*.mtimes" >mtimes &&
     +	test_must_be_empty mtimes
     +}
    @@ t/t6500-gc.sh: test_expect_success 'gc.cruftPacks=true generates a cruft pack' '
     +
     +		prepare_cruft_history &&
     +		git -c feature.experimental=true gc &&
    -+		assert_cruft_pack_exists
    ++		assert_cruft_packs
     +	)
     +'
     +
    @@ t/t6500-gc.sh: test_expect_success 'gc.cruftPacks=true generates a cruft pack' '
     +
     +		prepare_cruft_history &&
     +		git -c gc.cruftPacks=true -c feature.experimental=false gc &&
    -+		assert_cruft_pack_exists
    ++		assert_cruft_packs
    ++	)
    ++'
    ++
    ++test_expect_success 'feature.experimental=true can be overridden' '
    ++	git init crufts &&
    ++	test_when_finished "rm -fr crufts" &&
    ++	(
    ++		cd crufts &&
    ++
    ++		prepare_cruft_history &&
    ++		git -c feature.expiremental=true -c gc.cruftPacks=false gc &&
    ++		assert_no_cruft_packs
     +	)
     +'
     +
    @@ t/t6500-gc.sh: test_expect_success 'gc.cruftPacks=true generates a cruft pack' '
     +
     +		prepare_cruft_history &&
     +		git -c feature.experimental=false gc &&
    -+		refute_cruft_packs_exist
    ++		assert_no_cruft_packs
     +	)
     +'
     +
-- 
2.38.0.16.g393fd4c6db
Previous: Junio C HamanoNext: Taylor Blau
Message 8 of 11 in “gc: let feature.experimental imply gc.cruftPacks”
  1. 0/2 gc: let feature.experimental imply gc.cruftPacksTaylor Blau, Oct 26, 2022
  2. 1/2 gc: add tests for --cruft and friendsTaylor Blau, Oct 26, 2022
  3. Junio C HamanoOct 26, 2022
  4. 2/2 config: let feature.experimental imply gc.cruftPacks=trueTaylor Blau, Oct 26, 2022
  5. Junio C HamanoOct 26, 2022
  6. Taylor BlauOct 26, 2022
  7. Junio C HamanoOct 26, 2022
  8. 0/2 gc: let feature.experimental imply gc.cruftPacksTaylor Blau, Oct 26, 2022
  9. 1/2 gc: add tests for --cruft and friendsTaylor Blau, Oct 26, 2022
  10. 2/2 config: let feature.experimental imply gc.cruftPacks=trueTaylor Blau, Oct 26, 2022
  11. Derrick StoleeOct 31, 2022

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.