git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Glen Choo <chooglen@google.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
	Taylor Blau <me@ttaylorr.com>,
	Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH v3 0/3] Use default values from settings instead of config
Date: Tue, 05 Oct 2021 15:25:38 -0700	[thread overview]
Message-ID: <kl6lh7dvw1lp.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <87lf37ll4k.fsf@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I've looked this over carefully, it LGTM. I noticed some bugs in this
> area, but they pre-date your commits. I've pushed a
> "gc/use-repo-settings" to https://github.com/avar/git.git that you can
> check out, consider that branch partially as commentary, but feel free
> to pick/squash anything you find there.

Your review is very thoughtful, thank you :)

>  * This is somewhat of a case of throwing rocks from a glass house, but
>    I think the commit messages could really be shorter/get to the
>    point. I.e. say right away what's being changed and why, instead of
>    giving the reader an overview of the whole control flow.
>
>    I just adjusted adusted 1/3 in that direction below, I think 2/3
>    could do with being squashed into it & adjusted, it's really the
>    exact same bug/improvement, just with a different config key that
>    behaves the same.

In hindsight, I think this is how I should have initially structured my
commits because this improves the signal-noise ratio. I'll keep it in
mind in the future for sure. I'm hesitant to send a v4, but I can be
persuaded to do so :)

>  * The "test_unconfig" in your 2/3 is redundant, so is the "rm -rf" of
>    directories that can't exist by that point in 3/3.

These are redundant, but they serve a defensive purpose. By being extra
defensive, I was hoping to make it clear to the reader that the test is
*guaranteed* not to conflict with/rely on previous state and reduce the
number of greps needed.

>  * You use corrupting the graph as a shorthand for "did we run this
>    command?". See test_region for an approach that might be better,
>    i.e. just log with trace2 and grep that to see if we started the
>    relevant command. The test_region helper can't be used as-is for that
>    (you could manually grep the emitted PERF/EVENT output), but perhaps
>    that's easier/more reliable?

My intention here was not to assert "did git fsck call the function I
expected?", but something more along the lines of "did git fsck catch the
corrupted commit-graph?". Calling the function seems like an
implementation detail, but the actual desired behavior is that git fsck
catches the breakage.

Perhaps the test title should be reflect what I meant, like

  - git fsck (checks commit-graph when config set to true)
  + git fsck detects corrupted commit-graph

>  * This is again, something that pre-dates your patches, but I think
>    following the "is enabled?" behavior here for these variables in "git
>    fsck" is highly questionable. So just some thoughts after having
>    looked at that:

I think it depends on how we think about core.commitGraph (and others).
Do we want Git to be able to pretend that commit-graph doesn't exist at
all? If so, then we should skip the check in git fsck. Alternatively, is
commit-graph actually part of Git's core offering? If so,
core.commitGraph is more like a way to opt *out* of some commit-graph
behavior, but fsck should still verify our core data structures. Given
that we default to true, it sounds like more of the latter, but I'm not
sure what use case this serves.

>    Just because your config doen't say "use the graph" doesn't mean
>    another process won't do so, and if the graph is broken they might
>    probably encounter an error.

While that's true, I think that the user assumes a certain degree of
risk if they are using different commands with different config values.
I don't think it's unreasonable to say that "git -c
core.commitGraph=false fsck" won't catch issues that will arise in "git
-c core.commitGraph=true foo".

>    But in general for these auxiliary files (commit-graph, midix, *.rev
>    etc.) I think there's a good argument to be made that fsck should
>    *always* check them, and at most use the config to say something
>    like:
>
>        Hey, you've got a 100% broken commit-graph/midx/rev in your .git,
>        looks like the core.XYZ enabling it is off *right now* though, so
>        maybe we won't use it.  I hope you're feeling lucky...

I think "always check" sounds like the best way to maximize visibility
for users, though I don't think core.commitGraph should control the
severity of the warning/error. If we pursue "always check", I think we
could adopt fsck.<msg-id> instead.

  parent reply	other threads:[~2021-10-05 22:25 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 [this message]
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       ` [PATCH v5 " Glen Choo
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=kl6lh7dvw1lp.fsf@chooglen-macbookpro.roam.corp.google.com \
    --to=chooglen@google.com \
    --cc=avarab@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --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).