git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Glen Choo <chooglen@google.com>
To: git@vger.kernel.org
Cc: "Eric Sunshine" <sunshine@sunshineco.com>,
	"Taylor Blau" <me@ttaylorr.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Derrick Stolee" <derrickstolee@github.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Glen Choo" <chooglen@google.com>
Subject: [PATCH v5 0/3] Use default values from settings instead of config
Date: Fri, 15 Oct 2021 13:16:28 -0700	[thread overview]
Message-ID: <20211015201631.91524-1-chooglen@google.com> (raw)
In-Reply-To: <20211012174208.95161-1-chooglen@google.com>

  Hi everyone! This patch was created in response to something we observed in
  Google, where fsck failed to detect that the commit graph was invalid. We
  initially assumed that fsck never checked the commit graph, but it turns out
  that it does so only when core.commitgraph is set, even though we set defaults
  for "whether to use the commit graph" in the repository settings.

  Instead of using the config, let's use repository settings where
  available. Replace core.commitGraph and core.multiPackIndex with their
  equivalent repository settings in fsck and gc.

v5 is based off Ævar's fix (commit-graph: make "verify" work with replace refs,
[1]). As Ævar noted in v4, the mktag test failures indicated buggy behavior
"git commit-graph verify" when replace refs are enabled, so we should fix the
bug instead of just disabling commit-graph.

Ævar, Derrick, thanks for the productive discussion, I feel like I understand
this area a little better now.

Barring any unseen bugs, this should be ready to merge.

[1] https://lore.kernel.org/git/cover-0.3-00000000000-20211014T233343Z-avarab@gmail.com/

Changes since v4
* Rebase onto [1], which fixes a bug with commit-graph verify with replace refs
  enabled.
* Remove GIT_TEST_COMMIT_GRAPH=0 in t3800-mktag.sh because the bug that it was
  covering up is now fixed.

Changes since v3
* Disable GIT_TEST_COMMIT_GRAPH in tests that intentionally corrupt things in a
  way that is incompatible with commit-graphs.
* Make patch 1 and 2's commit messages more concise (thanks Ævar!).

Changes since v2:
* Various small test fixes (thanks Eric!). Most notably, I've used -c instead of
  test_config because test_config can affect the values in subsequent tests.
* Rewording fix in patch 3 commit message
* Refactor tests in patch 3 so that we use a single helper function instead of
  copy-pasted code

Changes since v1:
* clean up typo in patch 1 commit message 
* document the commits that patches 1 and 2 address
* use test helpers in patch 1
* rewrite patch 2's tests so that it's easier to tell that each test
  does something different
* reword patch 3 commit message to explain the bug
* add tests to patch 3

Glen Choo (3):
  fsck: verify commit graph when implicitly enabled
  fsck: verify multi-pack-index when implictly enabled
  gc: perform incremental repack when implictly enabled

 builtin/fsck.c              |  5 +++--
 builtin/gc.c                |  5 ++---
 t/t0410-partial-clone.sh    |  6 +++++-
 t/t5318-commit-graph.sh     | 23 ++++++++++++++++++++++-
 t/t5319-multi-pack-index.sh |  5 ++++-
 t/t7900-maintenance.sh      | 28 ++++++++++++++++++++++++----
 6 files changed, 60 insertions(+), 12 deletions(-)

Range-diff against v4:
1:  aac1253e7b ! 1:  567d40849a fsck: verify commit graph when implicitly enabled
    @@ Commit message
     
         Add tests to "t5318-commit-graph.sh" to verify that fsck checks the
         commit-graph as expected for the 3 values of core.commitGraph. Also,
    -    disable GIT_TEST_COMMIT_GRAPH for tests that use fsck in ways that
    -    assume that commit-graph checking is disabled (t/t3800-mktag.sh,
    -    t/t0410-partial-clone.sh).
    +    disable GIT_TEST_COMMIT_GRAPH in t/t0410-partial-clone.sh because some
    +    test cases use fsck in ways that assume that commit-graph checking is
    +    disabled.
     
         Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
         Signed-off-by: Glen Choo <chooglen@google.com>
    @@ t/t0410-partial-clone.sh: test_expect_success 'rev-list stops traversal at missi
      	! grep $FOO out
      '
     
    - ## t/t3800-mktag.sh ##
    -@@ t/t3800-mktag.sh: test_description='git mktag: tag object verify test'
    - 
    - . ./test-lib.sh
    - 
    -+# When enabled, some commands will automatically write commit-graphs.
    -+# This will cause the mktag tests to fail because fsck will attempt to
    -+# verify the out-of-sync commit graph.
    -+GIT_TEST_COMMIT_GRAPH=0
    -+
    - ###########################################################
    - # check the tag.sig file, expecting verify_tag() to fail,
    - # and checking that the error message matches the pattern
    -
      ## t/t5318-commit-graph.sh ##
     @@ t/t5318-commit-graph.sh: test_expect_success 'detect incorrect chunk count' '
      		$GRAPH_CHUNK_LOOKUP_OFFSET
2:  ed64983430 = 2:  7cb44a7aeb fsck: verify multi-pack-index when implictly enabled
3:  821b492d8b = 3:  a436c45af7 gc: perform incremental repack when implictly enabled
-- 
2.33.0.1079.g6e70778dc9-goog


  parent reply	other threads:[~2021-10-15 20:16 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 18:12 [PATCH 0/3] Use default values from settings instead of config Glen Choo
2021-09-13 18:12 ` [PATCH 1/3] fsck: verify commit graph when implicitly enabled Glen Choo
2021-09-13 19:29   ` Taylor Blau
2021-09-13 19:33     ` Eric Sunshine
2021-09-13 19:36       ` Taylor Blau
2021-09-13 23:15     ` Glen Choo
2021-09-13 23:32       ` Eric Sunshine
2021-09-14  1:09         ` Taylor Blau
2021-09-14  2:05           ` Eric Sunshine
2021-09-14  1:07       ` Taylor Blau
2021-09-13 18:12 ` [PATCH 2/3] fsck: verify multi-pack-index when implictly enabled Glen Choo
2021-09-13 19:35   ` Taylor Blau
2021-09-13 18:12 ` [PATCH 3/3] gc: perform incremental repack " Glen Choo
2021-09-13 19:37   ` Taylor Blau
2021-09-14 17:41     ` Glen Choo
2021-09-14  4:00   ` Bagas Sanjaya
2021-09-16 17:15     ` Glen Choo
2021-09-13 19:19 ` [PATCH 0/3] Use default values from settings instead of config Taylor Blau
2021-09-17 22:54 ` [PATCH v2 " Glen Choo
2021-09-17 22:54   ` [PATCH v2 1/3] fsck: verify commit graph when implicitly enabled Glen Choo
2021-09-29  6:09     ` Eric Sunshine
2021-09-30 18:00       ` Glen Choo
2021-09-30 18:35         ` Glen Choo
2021-09-30 18:39           ` Eric Sunshine
2021-10-01 17:28             ` Glen Choo
2021-09-17 22:54   ` [PATCH v2 2/3] fsck: verify multi-pack-index when implictly enabled Glen Choo
2021-09-29  6:20     ` Eric Sunshine
2021-09-29 22:56       ` Glen Choo
2021-09-17 22:54   ` [PATCH v2 3/3] gc: perform incremental repack " Glen Choo
2021-09-29  6:39     ` Eric Sunshine
2021-09-27 17:59   ` [PATCH v2 0/3] Use default values from settings instead of config Glen Choo
2021-09-29  6:43     ` Eric Sunshine
2021-09-29 22:53       ` Glen Choo
2021-10-05  0:19   ` [PATCH v3 " Glen Choo
2021-10-05  0:19     ` [PATCH v3 1/3] fsck: verify commit graph when implicitly enabled Glen Choo
2021-10-05  0:19     ` [PATCH v3 2/3] fsck: verify multi-pack-index when implictly enabled Glen Choo
2021-10-05  0:19     ` [PATCH v3 3/3] gc: perform incremental repack " Glen Choo
2021-10-05 11:57     ` [PATCH v3 0/3] Use default values from settings instead of config Ævar Arnfjörð Bjarmason
2021-10-05 17:43       ` Derrick Stolee
2021-10-05 19:10         ` Ævar Arnfjörð Bjarmason
2021-10-05 22:25       ` Glen Choo
2021-10-09  7:24     ` Junio C Hamano
2021-10-11 19:58       ` Glen Choo
2021-10-11 20:08         ` Junio C Hamano
2021-10-11 20:48           ` Glen Choo
2021-10-12 17:42     ` [PATCH v4 " Glen Choo
2021-10-12 17:42       ` [PATCH v4 1/3] fsck: verify commit graph when implicitly enabled Glen Choo
2021-10-12 17:42       ` [PATCH v4 2/3] fsck: verify multi-pack-index when implictly enabled Glen Choo
2021-10-12 17:42       ` [PATCH v4 3/3] gc: perform incremental repack " Glen Choo
2021-10-12 20:23       ` [PATCH v4 0/3] Use default values from settings instead of config Junio C Hamano
2021-10-12 20:34       ` Ævar Arnfjörð Bjarmason
2021-10-12 22:29         ` Glen Choo
2021-10-14 15:53           ` Ævar Arnfjörð Bjarmason
2021-10-13 13:12         ` Derrick Stolee
2021-10-13 15:57           ` Ævar Arnfjörð Bjarmason
2021-10-14 16:53             ` Derrick Stolee
2021-10-14 22:21               ` Glen Choo
2021-10-14 23:38                 ` Ævar Arnfjörð Bjarmason
2021-10-14 22:25               ` Junio C Hamano
2021-10-15 15:57                 ` Junio C Hamano
2021-10-15 20:16       ` Glen Choo [this message]
2021-10-15 20:16         ` [PATCH v5 1/3] fsck: verify commit graph when implicitly enabled Glen Choo
2021-10-15 20:16         ` [PATCH v5 2/3] fsck: verify multi-pack-index when implictly enabled Glen Choo
2021-10-15 20:16         ` [PATCH v5 3/3] gc: perform incremental repack " Glen Choo
2021-10-15 21:31         ` [PATCH v5 0/3] Use default values from settings instead of config Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211015201631.91524-1-chooglen@google.com \
    --to=chooglen@google.com \
    --cc=avarab@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).