git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH 1/3] Allow debugging unsafe directories' ownership
Date: Wed, 13 Jul 2022 12:35:43 -0700	[thread overview]
Message-ID: <xmqq5yk0dcvk.fsf@gitster.g> (raw)
In-Reply-To: <3480381b8b99142bcc0213957a43d68a962c52d9.1657700238.git.gitgitgadget@gmail.com> (Johannes Schindelin via GitGitGadget's message of "Wed, 13 Jul 2022 08:17:15 +0000")

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> When Git refuses to use an existing repository because it is owned by
> someone else than the current user, it can be a bit tricky on Windows to
> figure out what is going on.
>
> Let's help with that by offering some more information via the
> environment variable `GIT_TEST_DEBUG_UNSAFE_DIRECTORIES`.

I can see how the change to compat/ part is useful, but ...

> diff --git a/setup.c b/setup.c
> index 9dcecda65b0..3ba42ffcb27 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -1353,13 +1353,23 @@ const char *setup_git_directory_gently(int *nongit_ok)
>  	case GIT_DIR_INVALID_OWNERSHIP:
>  		if (!nongit_ok) {
>  			struct strbuf quoted = STRBUF_INIT;
> +			struct strbuf hint = STRBUF_INIT;
> +
> +#ifdef __MINGW32__
> +			if (!git_env_bool("GIT_TEST_DEBUG_UNSAFE_DIRECTORIES", 0))
> +				strbuf_addstr(&hint,
> +					      _("\n\nSet the environment variable "
> +						"GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true "
> +						"and run\n"
> +						"again for more information."));
> +#endif

... I am not sure about this part.  Do we have any other codepath to
show "to debug, run the program with this" suggestion?  Adding it in
the documentation is probably good, but this is an extra message
that is much larger than the "owned by X but you are Y" message that
would be shown.  With or without the environment set, the output
will become noisier with this patch.  I wonder if we are better off
giving the information that is given in the warning (in compat/ part
of the patch) _unconditionally_ in the message, which would make it
less noisy overall.

Also what's our vision for non-Windows platform for "further
debugging aid" in this area?  Would we perhaps want a similar
"warning" that says "owned by X but you are Y"?

Thanks.

  reply	other threads:[~2022-07-13 19:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  8:17 [PATCH 0/3] Some improvements to safe.directory on Windows Johannes Schindelin via GitGitGadget
2022-07-13  8:17 ` [PATCH 1/3] Allow debugging unsafe directories' ownership Johannes Schindelin via GitGitGadget
2022-07-13 19:35   ` Junio C Hamano [this message]
2022-07-14 21:40     ` Junio C Hamano
2022-07-15 14:33       ` Johannes Schindelin
2022-08-08 13:29         ` Johannes Schindelin
2022-07-13  8:17 ` [PATCH 2/3] mingw: handle a file owned by the Administrators group correctly Johannes Schindelin via GitGitGadget
2022-07-13  8:17 ` [PATCH 3/3] mingw: be more informative when ownership check fails on FAT32 Johannes Schindelin via GitGitGadget
2022-08-08 13:27 ` [PATCH v2 0/5] Some improvements to safe.directory on Windows Johannes Schindelin via GitGitGadget
2022-08-08 13:27   ` [PATCH v2 1/5] setup: fix some formatting Johannes Schindelin via GitGitGadget
2022-08-08 13:27   ` [PATCH v2 2/5] Prepare for more detailed "dubious ownership" messages Johannes Schindelin via GitGitGadget
2022-08-08 13:27   ` [PATCH v2 3/5] mingw: provide details about unsafe directories' ownership Johannes Schindelin via GitGitGadget
2022-08-08 13:27   ` [PATCH v2 4/5] mingw: be more informative when ownership check fails on FAT32 Johannes Schindelin via GitGitGadget
2022-08-08 13:27   ` [PATCH v2 5/5] mingw: handle a file owned by the Administrators group correctly Johannes Schindelin via GitGitGadget
2022-08-08 16:38   ` [PATCH v2 0/5] Some improvements to safe.directory on Windows Junio C Hamano
2022-08-09  8:59     ` Johannes Schindelin

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=xmqq5yk0dcvk.fsf@gitster.g \
    --to=gitster@pobox.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 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 NNTP newsgroup(s).