threads / patch / 64551

patch, 2 partsUpdate documentation/discoverability around `scalar`

Subject: [PATCH 0/2] Update documentation/discoverability around `scalar`

## tl;dr

4 messages between Nov 29, 2025 and Nov 29, 2025. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Matthew Hughes· Nov 29, 2025, 17:21 UTC · lore

A couple of changes following on from a discussion around the discoverability of `scalar` config changes[1].

Following that thread, I was additionally working on a patch that would involve commenting each of the changes and why they're set. But that was taking me longer than expected so I figured I get these smaller changes up rather than waiting to complete everything.

Link: https://lore.kernel.org/git/vppjutjcdglp44qvsk4qozphycyg663yrq5775zztim2oe7ty5@uttjrshb52bd/ [1]
Matthew Hughes (2):
  scalar: add comments when setting config
  config: document `gui.GCWarning`
 Documentation/config/gui.adoc | 5 +++++
 scalar.c                      | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
-- 
2.51.0
Matthew Hughes· Nov 29, 2025, 17:22 UTC · re: Matthew Hughes · lore

[PATCH 1/2] scalar: add comments when setting config

This is to help users understand that a change in the config was made by `scalar` (and not e.g. manually by themselves at some point in the past).

As discussed on a thread[1].
Link: https://lore.kernel.org/git/aMkVqNbdgxqBJ9K4@pks.im/ [1]
Co-authored-by: Derrick Stolee <stolee@gmail.com>
---
 scalar.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Show changes to scalar.c +5 −1
diff --git a/scalar.c b/scalar.c
index f754311627..4bdf8cf121 100644
--- a/scalar.c
+++ b/scalar.c
@@ -19,6 +19,7 @@
 #include "help.h"
 #include "setup.h"
 #include "trace2.h"
+#include "path.h"
 
 static void setup_enlistment_directory(int argc, const char **argv,
 				       const char * const *usagestr,
@@ -102,8 +103,11 @@ static int set_scalar_config(const struct scalar_config *config, int reconfigure
 
 	if ((reconfigure && config->overwrite_on_reconfigure) ||
 	    repo_config_get_string(the_repository, config->key, &value)) {
+		char *cfg_file = repo_git_path(the_repository, "config");
+		const char *comment = " # set by git-scalar";
 		trace2_data_string("scalar", the_repository, config->key, "created");
-		res = repo_config_set_gently(the_repository, config->key, config->value);
+		res = repo_config_set_in_file_gently(the_repository, cfg_file, config->key, comment, config->value);
+		free(cfg_file);
 	} else {
 		trace2_data_string("scalar", the_repository, config->key, "exists");
 		res = 0;
-- 
2.51.0
Matthew Hughes· Nov 29, 2025, 17:22 UTC · re: Matthew Hughes · lore

[PATCH 2/2] config: document `gui.GCWarning`

While investigating the config options set by `scalar` I noticed this
one wasn't documented.
---
 Documentation/config/gui.adoc | 5 +++++
 1 file changed, 5 insertions(+)
Show changes to Documentation/config/gui.adoc +5 −0
diff --git a/Documentation/config/gui.adoc b/Documentation/config/gui.adoc
index 171be774d2..3323ff9b7e 100644
--- a/Documentation/config/gui.adoc
+++ b/Documentation/config/gui.adoc
@@ -55,3 +55,8 @@ gui.blamehistoryctx::
 	linkgit:gitk[1] for the selected commit, when the `Show History
 	Context` menu item is invoked from 'git gui blame'. If this
 	variable is set to zero, the whole history is shown.
+
+gui.GCWarning:
+	Determines whether linkgit:git-gui[1] should prompt for garbage
+	collection when git detects a large number of loose objects in
+	the repository. The default value is "true".
-- 
2.51.0

← back to recent threads