git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] scalar reconfigure -a: remove stale `scalar.repo` entries
Date: Mon, 7 Nov 2022 14:03:15 -0500	[thread overview]
Message-ID: <Y2lWc2gmPaTfi4k5@nand.local> (raw)
In-Reply-To: <pull.1407.git.1667845501422.gitgitgadget@gmail.com>

On Mon, Nov 07, 2022 at 06:25:01PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> Every once in a while, a Git for Windows installation fails because the
> attempt to reconfigure a Scalar enlistment failed because it was deleted
> manually without removing the corresponding entries in the global Git
> config.
>
> In f5f0842d0b5 (scalar: let 'unregister' handle a deleted enlistment
> directory gracefully, 2021-12-03), we already taught `scalar delete` to
> handle the case of a manually deleted enlistment gracefully. This patch
> adds the same graceful handling to `scalar reconfigure --all`.

Makes sense, thanks.

> @@ -166,6 +166,17 @@ test_expect_success 'scalar reconfigure' '
>  	test true = "$(git -C one/src config core.preloadIndex)"
>  '
>
> +test_expect_success '`reconfigure -a` removes stale config entries' '
> +	git init stale/src &&
> +	scalar register stale &&
> +	scalar list >scalar.repos &&
> +	grep stale scalar.repos &&
> +	rm -rf stale &&
> +	scalar reconfigure -a &&
> +	scalar list >scalar.repos &&
> +	! grep stale scalar.repos

Arguably this test would be slightly improved if we checked not only for
'!grep stale scalar.repos', but that the correct set of repositories
*does* appear in the list.

But presumably we have plenty of other tests which do so already, so
we're not lacking any coverage here by omitting it.

This patch looks good to me, will queue.

Thanks,
Taylor

  reply	other threads:[~2022-11-07 19:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 18:25 [PATCH] scalar reconfigure -a: remove stale `scalar.repo` entries Johannes Schindelin via GitGitGadget
2022-11-07 19:03 ` Taylor Blau [this message]
2022-11-07 20:14 ` Derrick Stolee

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=Y2lWc2gmPaTfi4k5@nand.local \
    --to=me@ttaylorr.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).