# [PATCH v2 0/2] Update documentation/discoverability around `scalar`

8 messages from 2025-11-29 to 2025-11-30. Participants: Matthew Hughes, Ben Knoble, Junio C Hamano, Derrick Stolee.
Thread: https://gitlist.dev/t/64553

## Matthew Hughes, 2025-11-29 18:32

Subject: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <20251129183236.52760-1-matthewhughes934@gmail.com>
URL: https://gitlist.dev/e/20251129183236.52760-1-matthewhughes934%40gmail.com

```
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.

---
Changes in v2:
- Add missing commit signoffs

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.52.0


```

## Matthew Hughes, 2025-11-29 18:33

Subject: [PATCH v2 1/2] scalar: add comments when setting config
Message-ID: <20251129183236.52760-2-matthewhughes934@gmail.com>
URL: https://gitlist.dev/e/20251129183236.52760-2-matthewhughes934%40gmail.com
In-Reply-To: <20251129183236.52760-1-matthewhughes934@gmail.com>

```
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>
Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
---
 scalar.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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.52.0


```

## Matthew Hughes, 2025-11-29 18:33

Subject: [PATCH v2 2/2] config: document `gui.GCWarning`
Message-ID: <20251129183236.52760-3-matthewhughes934@gmail.com>
URL: https://gitlist.dev/e/20251129183236.52760-3-matthewhughes934%40gmail.com
In-Reply-To: <20251129183236.52760-1-matthewhughes934@gmail.com>

```
While investigating the config options set by `scalar` I noticed this
one wasn't documented.

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
---
 Documentation/config/gui.adoc | 5 +++++
 1 file changed, 5 insertions(+)

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.52.0


```

## Ben Knoble, 2025-11-29 19:55

Subject: Re: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <FD92D0BF-E2C0-485E-A121-4C92BD20F7F9@gmail.com>
URL: https://gitlist.dev/e/FD92D0BF-E2C0-485E-A121-4C92BD20F7F9%40gmail.com
In-Reply-To: <20251129183236.52760-1-matthewhughes934@gmail.com>

```

> Le 29 nov. 2025 à 13:33, Matthew Hughes <matthewhughes934@gmail.com> a écrit :
> 
> ﻿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.

I think Stolee implemented a few similar things in GitGitGadget PR 2010


```

## Matthew Hughes, 2025-11-29 23:05

Subject: Re: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <jcqsqytuxpqwn3yhpz7fxucbuuf635q3jfgkjzauxwhrkhl7gg@g42r5kwwoknd>
URL: https://gitlist.dev/e/jcqsqytuxpqwn3yhpz7fxucbuuf635q3jfgkjzauxwhrkhl7gg%40g42r5kwwoknd
In-Reply-To: <FD92D0BF-E2C0-485E-A121-4C92BD20F7F9@gmail.com>

```
On Sat, Nov 29, 2025 at 02:55:10PM -0500, Ben Knoble wrote:
> I think Stolee implemented a few similar things in GitGitGadget PR 2010

Ah, indeed it looks like it with https://github.com/gitgitgadget/git/pull/2010,
that also covers the first patch of this patchset. So In that case I might just
redraw this patchset and submit the second commit on its own as a documentation
improvement, thanks!

```

## Junio C Hamano, 2025-11-29 23:09

Subject: Re: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <xmqqqztgcu67.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqqztgcu67.fsf%40gitster.g
In-Reply-To: <FD92D0BF-E2C0-485E-A121-4C92BD20F7F9@gmail.com>

```
Ben Knoble <ben.knoble@gmail.com> writes:

>> Le 29 nov. 2025 à 13:33, Matthew Hughes <matthewhughes934@gmail.com> a écrit :
>> 
>> ﻿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.
>
> I think Stolee implemented a few similar things in GitGitGadget PR 2010

Also known as

    https://lore.kernel.org/git/pull.2010.git.1764195516.gitgitgadget@gmail.com/

queued on 'ds/doc-scalar-config' topic that ends at c483f0a5
(scalar: document config settings, 2025-11-26).

```

## Ben Knoble, 2025-11-30 18:39

Subject: Re: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <7AB80AA4-D3B6-46F9-B02C-7A60A9A1C5EC@gmail.com>
URL: https://gitlist.dev/e/7AB80AA4-D3B6-46F9-B02C-7A60A9A1C5EC%40gmail.com
In-Reply-To: <xmqqqztgcu67.fsf@gitster.g>

```

> Le 29 nov. 2025 à 18:09, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> ﻿Ben Knoble <ben.knoble@gmail.com> writes:
> 
>>>> Le 29 nov. 2025 à 13:33, Matthew Hughes <matthewhughes934@gmail.com> a écrit :
>>> 
>>> ﻿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.
>> 
>> I think Stolee implemented a few similar things in GitGitGadget PR 2010
> 
> Also known as
> 
>    https://lore.kernel.org/git/pull.2010.git.1764195516.gitgitgadget@gmail.com/
> 
> queued on 'ds/doc-scalar-config' topic that ends at c483f0a5
> (scalar: document config settings, 2025-11-26).

Thanks. If I paste URLs into my phone’s email client, the message I’m composing is no longer plain text. Ditto if I paste the message id from lore. And this was a long one to type by hand, so 😅
```

## Derrick Stolee, 2025-11-30 19:54

Subject: Re: [PATCH v2 0/2] Update documentation/discoverability around `scalar`
Message-ID: <06bebb27-c9df-41da-997d-14299fd2ffe9@gmail.com>
URL: https://gitlist.dev/e/06bebb27-c9df-41da-997d-14299fd2ffe9%40gmail.com
In-Reply-To: <jcqsqytuxpqwn3yhpz7fxucbuuf635q3jfgkjzauxwhrkhl7gg@g42r5kwwoknd>

```
On 11/29/2025 6:05 PM, Matthew Hughes wrote:
> On Sat, Nov 29, 2025 at 02:55:10PM -0500, Ben Knoble wrote:
>> I think Stolee implemented a few similar things in GitGitGadget PR 2010
> 
> Ah, indeed it looks like it with https://github.com/gitgitgadget/git/pull/2010,
> that also covers the first patch of this patchset. So In that case I might just
> redraw this patchset and submit the second commit on its own as a documentation
> improvement, thanks!
 
I see that you also used the US Thanksgiving holidays as an opportunity to catch
up on this thread. Thanks for the initiative! I'd love your feedback on [1].

Thanks,
-Stolee

[1] https://lore.kernel.org/git/pull.2010.git.1764195516.gitgitgadget@gmail.com

```
