aboutsummaryrefslogtreecommitdiffstats
path: root/scalar.c
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2025-05-07 01:50:35 +0000
committerJunio C Hamano <gitster@pobox.com>2025-05-07 14:04:31 -0700
commit9816e24a78e3973164f324d50caa948ecfa2ab81 (patch)
tree8a5a08af7c177cc45c476e669c99d5eb35dd79f2 /scalar.c
parentc428216d4df289704ad01bb413c177bc0de32e0c (diff)
downloadgit-9816e24a78e3973164f324d50caa948ecfa2ab81.tar.gz
scalar register: add --no-maintenance option
When registering a repository with Scalar to get the latest opinionated configuration, the 'scalar register' command will also set up background maintenance. This is a recommended feature for most user scenarios. However, this is not always recommended in some scenarios where background modifications may interfere with foreground activities. Specifically, setting up a clone for use in automation may require doing certain maintenance steps in the foreground that could become blocked by concurrent background maintenance operations. Allow the user to specify --no-maintenance to 'scalar register'. This requires updating the method prototype for register_dir(), so use the default of enabling this value when otherwise specified. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'scalar.c')
-rw-r--r--scalar.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scalar.c b/scalar.c
index b20b063471..da0c46bc96 100644
--- a/scalar.c
+++ b/scalar.c
@@ -612,11 +612,14 @@ static int cmd_list(int argc, const char **argv UNUSED)
static int cmd_register(int argc, const char **argv)
{
+ int maintenance = 1;
struct option options[] = {
+ OPT_BOOL(0, "maintenance", &maintenance,
+ N_("specify if background maintenance should be enabled")),
OPT_END(),
};
const char * const usage[] = {
- N_("scalar register [<enlistment>]"),
+ N_("scalar register [--[no-]maintenance] [<enlistment>]"),
NULL
};
@@ -625,7 +628,8 @@ static int cmd_register(int argc, const char **argv)
setup_enlistment_directory(argc, argv, usage, options, NULL);
- return register_dir(1);
+ /* If --no-maintenance, then leave maintenance as-is. */
+ return register_dir(maintenance);
}
static int get_scalar_repos(const char *key, const char *value,