All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Derrick Stolee <derrickstolee@github.com>
Cc: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, johannes.schindelin@gmx.de
Subject: Re: [PATCH v2 3/3] scalar reconfigure: help users remove buggy repos
Date: Fri, 25 Aug 2023 11:05:17 -0700	[thread overview]
Message-ID: <xmqqsf8780bm.fsf@gitster.g> (raw)
In-Reply-To: f751dc4d-b605-43ef-8b73-082e8acd5914@github.com

Derrick Stolee <derrickstolee@github.com> writes:

> On 8/22/2023 3:45 PM, Junio C Hamano wrote:
>> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>>> +		switch (discover_git_directory_reason(&commondir, &gitdir)) {
>>> +		case GIT_DIR_INVALID_OWNERSHIP:
>>> +			warning(_("repository at '%s' has different owner"), dir);
>>> +			goto loop_end;
>>> +
>>> +		case GIT_DIR_DISCOVERED:
>>> +			succeeded = 1;
>>> +			break;
>>> +
>>> +		default:
>>> +			warning(_("repository not found in '%s'"), dir);
>>> +			break;
>> 
>> Among the error cases, INVALID_OWNERSHIP is one of the possibilities
>> that merits specialized message to the end-user.  I wonder if others
>> also deserve to be explained, though.
>
> The specific choice of GIT_DIR_INVALID_OWNERSHIP is singled out
> because it's a new-ish reason and is the most confusing to users
> when things fail for this reason.
>  
>>  - HIT_CEILING and HIT_MOUNT_POINT will happen when there is no
>>    usable repository between "dir" and the specified ceiling.
>
> These are basically "didn't find a Git repo" but there are different
> reasons why Git stopped looking. I'm not sure there is something more
> valuable to indicate here than the "repository not found" message
> that already exists.

OK.  I just know that "not found" will be greeted by "stupid Git, if
you go one level up, there is a .git/ directory!", now we have many
users than we used to have and people forget what they configured.

But I think it would apply much less to users who see "repository
not found" in the "scalar reconfigure" than ones who manually
created a repository, and then forgot that they shuffled the disks
around with cross mounting.  So I agree with you that it is not
essential to mention these reasons in this codepath (and
setup_git_directory() does have a reasonable message for at least
the mount-point case that covers the more general case).

>>  - INVALID_GITFILE and INVALID_FORMAT are signs of some repository
>>    corruption.
>
> I can add a message for this kind of error, which seems helpful to
> point out to a user.

Maybe.  We can do that in a follow-up topic separately.

Thanks.

  reply	other threads:[~2023-08-25 18:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 15:12 [PATCH 0/3] scalar: two downstream improvements Derrick Stolee via GitGitGadget
2023-08-14 15:12 ` [PATCH 1/3] scalar: add --[no-]src option Derrick Stolee via GitGitGadget
2023-08-14 16:02   ` Junio C Hamano
2023-08-14 19:20     ` Derrick Stolee
2023-08-14 15:12 ` [PATCH 2/3] setup: add discover_git_directory_reason() Derrick Stolee via GitGitGadget
2023-08-14 16:29   ` Junio C Hamano
2023-08-14 16:55     ` Junio C Hamano
2023-08-14 15:12 ` [PATCH 3/3] scalar reconfigure: help users remove buggy repos Derrick Stolee via GitGitGadget
2023-08-14 16:44   ` Junio C Hamano
2023-08-22 17:24 ` [PATCH v2 0/3] scalar: two downstream improvements Derrick Stolee via GitGitGadget
2023-08-22 17:24   ` [PATCH v2 1/3] scalar: add --[no-]src option Derrick Stolee via GitGitGadget
2023-08-23  9:25     ` Oswald Buddenhagen
2023-08-22 17:24   ` [PATCH v2 2/3] setup: add discover_git_directory_reason() Derrick Stolee via GitGitGadget
2023-08-22 19:30     ` Junio C Hamano
2023-08-22 19:39       ` Derrick Stolee
2023-08-23  9:58     ` Oswald Buddenhagen
2023-08-22 17:24   ` [PATCH v2 3/3] scalar reconfigure: help users remove buggy repos Derrick Stolee via GitGitGadget
2023-08-22 19:45     ` Junio C Hamano
2023-08-25 17:21       ` Derrick Stolee
2023-08-25 18:05         ` Junio C Hamano [this message]
2023-08-28 13:52   ` [PATCH v3 0/3] scalar: two downstream improvements Derrick Stolee via GitGitGadget
2023-08-28 13:52     ` [PATCH v3 1/3] scalar: add --[no-]src option Derrick Stolee via GitGitGadget
2023-08-28 13:52     ` [PATCH v3 2/3] setup: add discover_git_directory_reason() Derrick Stolee via GitGitGadget
2023-08-28 13:52     ` [PATCH v3 3/3] scalar reconfigure: help users remove buggy repos Derrick Stolee via GitGitGadget
2023-08-28 16:22     ` [PATCH v3 0/3] scalar: two downstream improvements 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

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

  git send-email \
    --in-reply-to=xmqqsf8780bm.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.