Re: [PATCH 11/15] scalar: allow reconfiguring an existing enlistment
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 31, 2021, 08:29 UTC
- Message-ID
- <874kb6xbf9.fsf@evledraar.gmail.com>
- In-Reply-To
- <13056f02018542f8143e4933fbe180a0a9f77004.1630359290.git.gitgitgadget@gmail.com>
On Mon, Aug 30 2021, Johannes Schindelin via GitGitGadget wrote:
> This comes in handy during Scalar upgrades, or when config settings were > messed up by mistake.
> [...] > const char *key; > const char *value; > + int overwrite_on_reconfigure;
If you make this a "keep_on_reconfigure", then ...
Show 10 quoted lines
> } config[] = {
> - { "am.keepCR", "true" },
> - { "core.FSCache", "true" },
> - { "core.multiPackIndex", "true" },
> - { "core.preloadIndex", "true" },
> + /* Required */
> + { "am.keepCR", "true", 1 },
> + { "core.FSCache", "true", 1 },
> + { "core.multiPackIndex", "true", 1 },
> + { "core.preloadIndex", "true", 1 },You won't need the churn/boilerplate of adding "1" to everything here, but can just change the initial patch to use designated initializers.
That along with a throwaway macro like:
#define SCALAR_CFG_TRUE(k) (.key = k, .value = "true") #define SCALAR_CFG_FALSE(k) (.key = k, .value = "false")
Might (or might not) make this even easier to eyeball...