Thread (34 messages) flat view 34 messages, 6 authors, 2026-02-10

Re: [PATCH 09/11] config-batch: add 'set' v1 command

From: Jean-Noël Avila <hidden>
Date: 2026-02-06 05:05:07

Le 04/02/2026 à 15:20, Derrick Stolee via GitGitGadget a écrit :
quoted hunk ↗ jump to hunk
From: Derrick Stolee <redacted>

This new command is intended for single-value assignments to a specific
chosen scope. More complicated versions of the 'git config set' command
will be incorporated into future commands.

Signed-off-by: Derrick Stolee <redacted>
---
 Documentation/git-config-batch.adoc | 24 ++++++++
 builtin/config-batch.c              | 71 ++++++++++++++++++++++
 config.c                            | 27 +++++++++
 config.h                            |  3 +
 t/t1312-config-batch.sh             | 94 ++++++++++++++++++++++++++++-
 5 files changed, 217 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-config-batch.adoc b/Documentation/git-config-batch.adoc
index 3c9a3bb763..feec85c4ef 100644
--- a/Documentation/git-config-batch.adoc
+++ b/Documentation/git-config-batch.adoc
@@ -111,6 +111,30 @@ get 1 missing <key> [<value-pattern>|<value>]
 where `<value-pattern>` or `<value>` is only supplied if provided in
 the command.
 
+`set` version 1::
+	The `set` command writes a single key-value pair to a config
Please use direct imperative form.
+	file. It specifies which file by a `<scope>` parameter from
+	among `system`, `global`, `local`, and `worktree`. The `<key>`
+	is the next positional argument. The remaining data in the line
+	is provided as the `<value>` to assign the config.
++
+------------
+set 1 <scope> <key> <value>
+------------
++
+These uses will match the behavior of `git config --set --<scope> <key>
This "--<scope>" form is new in the synopsis grammar. Would we just cite
all alternatives or use a "normal" placeholder _<scope>_ ?
+<value>`. Note that replacing all values with the `--all` option or
+matching specific value patterns are not supported by this command.
++
+The response of these commands will include a `success` message if the
+value is written as expected or `failed` if an unexpected failure
+occurs:
++
+------------
+set 1 success <scope> <key> <value>
+set 1 failed <scope> <key> <value>
+------------
+
Please use synopsis style block for these too.
 NUL-Terminated Format
 ~~~~~~~~~~~~~~~~~~~~~
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help