git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Victoria Dye <vdye@github.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Josh Steadmon <steadmon@google.com>,
	git@vger.kernel.org, lessleydennington@gmail.com
Subject: Re: [RFC PATCH] repo-settings: set defaults even when not in a repo
Date: Wed, 23 Mar 2022 14:19:23 -0700	[thread overview]
Message-ID: <1e69a59f-aa71-fb04-971b-6cffbd000512@github.com> (raw)
In-Reply-To: <xmqqpmmcqtii.fsf@gitster.g>

Junio C Hamano wrote:
> Victoria Dye <vdye@github.com> writes:
> 
>> I think the decision of whether to go with this approach or the alternative
>> listed below depends on the validity of a 'repository' without a gitdir. 
>>
>> As far as I can tell, there is an implicit conflict between the changes in:
>>
>> 1. b66d84756f (commit-graph: respect 'commitGraph.readChangedPaths',
>>    2020-09-09)
>> 2. 44c7e62e51 (repo-settings: prepare_repo_settings only in git repos,
>>    2021-12-06) (as you pointed out in your message)
>>
>> The former says that commit-graph should use a repository setting (implying
>> it needs a valid repository), and the latter says that you need a valid
>> gitdir to get repository settings.
>>
>> So to me, how to proceed depends on whether a repository can be "valid"
>> without a gitdir or not:
> 
> Sorry, I do not get it.  What does "a repository without a git dir"
> look like?  It does not make any sense to me.  A repository without
> working tree, I can understand.

I think that answers my question - if it doesn't make sense to have a
"repository without a git dir", then the code shouldn't allow
'the_repository' to be used without a valid 'the_repository.gitdir'. The
'BUG()' in 'prepare_repo_settings()' enforces that condition right now, so
removing it like this RFC does would make the tests fragile and the code
more prone to future bugs.

That said, if it's conceptually sensible for 'fuzz-commit-graph' to work
without a repository, then it could be updated to get its defaults from
somewhere other than 'the_repository' when the repo doesn't exist (like what
I mentioned in [1] ("If the 'repository' really is..."), or Taylor's
suggestion in [2]).

[1] https://lore.kernel.org/git/fcfdcbb9-761a-0d34-7d36-61e0ef279922@github.com/
[2] https://lore.kernel.org/git/Yjt6mLIfw0V3aVTO@nand.local/

  reply	other threads:[~2022-03-23 21:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 18:03 [RFC PATCH] repo-settings: set defaults even when not in a repo Josh Steadmon
2022-03-23 19:22 ` Derrick Stolee
2022-03-23 19:52   ` Taylor Blau
2022-03-28 19:15     ` Josh Steadmon
2022-03-29  1:21       ` Taylor Blau
2022-03-28 19:53     ` Josh Steadmon
2022-03-29  1:22       ` Taylor Blau
2022-03-29  9:03     ` Ævar Arnfjörð Bjarmason
2022-03-30  2:26       ` Taylor Blau
2022-04-09  6:33         ` Josh Steadmon
2022-03-29  9:04     ` Ævar Arnfjörð Bjarmason
2022-03-30  2:34       ` Taylor Blau
2022-03-30 17:38         ` Ævar Arnfjörð Bjarmason
2022-03-30 20:14           ` Junio C Hamano
2022-04-09  6:52     ` [RFC PATCH v2] commit-graph: refactor to avoid prepare_repo_settings Josh Steadmon
2022-06-07 20:02       ` Jonathan Tan
2022-06-14 22:38         ` Josh Steadmon
2022-06-14 22:37     ` [PATCH v3] " Josh Steadmon
2022-06-14 23:32       ` Taylor Blau
2022-06-23 21:59       ` Junio C Hamano
2022-07-14 21:44         ` Josh Steadmon
2022-07-14 21:43     ` [PATCH v4] commit-graph: pass repo_settings instead of repository Josh Steadmon
2022-07-14 22:48       ` Junio C Hamano
2022-03-23 20:11 ` [RFC PATCH] repo-settings: set defaults even when not in a repo Victoria Dye
2022-03-23 20:54   ` Junio C Hamano
2022-03-23 21:19     ` Victoria Dye [this message]
2022-03-23 20:51 ` 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=1e69a59f-aa71-fb04-971b-6cffbd000512@github.com \
    --to=vdye@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lessleydennington@gmail.com \
    --cc=steadmon@google.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).