git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] scalar: configure maintenance during 'reconfigure'

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 20, 2024, 00:00 UTC
Message-ID
<965a08a5d526ae75428727d0f9aa22ea22a25ed9.1726790424.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1798.git.1726790423.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

The 'scalar reconfigure' command is intended to update registered repos with the latest settings available. However, up to now we were not reregistering the repos with background maintenance.

In particular, this meant that the background maintenance schedule would not be updated if there are improvements between versions.

Be sure to register repos for maintenance during the reconfigure step.
Signed-off-by: Derrick Stolee <stolee@gmail.com>
---
 scalar.c          | 3 +++
 t/t9210-scalar.sh | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/scalar.c b/scalar.c
index 09560aeab54..73b79a5d4c9 100644
--- a/scalar.c
+++ b/scalar.c
@@ -733,6 +733,9 @@ static int cmd_reconfigure(int argc, const char **argv)
 
 		the_repository = old_repo;
 
+		if (toggle_maintenance(1) >= 0)
+			succeeded = 1;
+
 loop_end:
 		if (!succeeded) {
 			res = -1;
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index e8613990e13..027235d61aa 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -194,8 +194,11 @@ test_expect_success 'scalar reconfigure' '
 	scalar reconfigure one &&
 	test true = "$(git -C one/src config core.preloadIndex)" &&
 	git -C one/src config core.preloadIndex false &&
-	scalar reconfigure -a &&
-	test true = "$(git -C one/src config core.preloadIndex)"
+	rm one/src/cron.txt &&
+	GIT_TRACE2_EVENT="$(pwd)/reconfigure" scalar reconfigure -a &&
+	test_path_is_file one/src/cron.txt &&
+	test true = "$(git -C one/src config core.preloadIndex)" &&
+	test_subcommand git maintenance start <reconfigure
 '
 
 test_expect_success 'scalar reconfigure --all with includeIf.onbranch' '
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Junio C Hamano
Message 5 of 8 in “maintenance: configure credentials to be silent”
  1. 0/3 maintenance: configure credentials to be silentDerrick Stolee via GitGitGadget, Sep 20, 2024
  2. 1/3 credential: add new interactive config optionDerrick Stolee via GitGitGadget, Sep 20, 2024
  3. Junio C HamanoSep 20, 2024
  4. 2/3 maintenance: add custom config to background jobsDerrick Stolee via GitGitGadget, Sep 20, 2024
  5. 3/3 scalar: configure maintenance during 'reconfigure'Derrick Stolee via GitGitGadget, Sep 20, 2024
  6. Junio C HamanoSep 20, 2024
  7. Derrick StoleeSep 23, 2024
  8. Junio C HamanoSep 23, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.