Thread (3 messages) flat view 3 messages, 3 authors, 2026-02-05

Re: [PATCH 01/11] config-batch: basic boilerplate of new builtin

From: Derrick Stolee <hidden>
Date: 2026-02-05 14:18:01

On 2/4/2026 6:23 PM, Junio C Hamano wrote:
"Derrick Stolee via GitGitGadget" [off-list ref] writes:
quoted
From: Derrick Stolee <redacted>

Later changes will document, implement, and test this new builtin. For now,
this serves as the latest example of the minimum boilerplate to introduce a
new builtin.

Recently, we updated the comment in builtin.h about how to create a new
builtin, but failed to mention the required change to meson.build files for
some CI builds to pass. Fix that oversight.

Signed-off-by: Derrick Stolee <redacted>
---
We have had a bad reputation for having too many commands; would it
be better to present it as a new mode of existing "git config"
command at the end-user level, I wonder?
Interesting thought. I think we also have a bad reputation of commands
that are overloaded with too many purposes.

In this case, though, I do think that the modern 'git config <subcommand>'
model presents some clear boundaries for how the command should behave
with the 'batch' (or 'server') subcommand. Grouping all config-related
operations in the same builtin may be ideal. 
Also after reading patches for a few early steps, I do not quite see
"batch"-ness in this protocol; it is strictly "a single request is
met with a single response".
The batch-ness is that multiple requests can eventually go to the same
process. The client could collect multiple commands in a batch and send
them all without processing the responses one-by-one. This is how it works
in the tests: a single input file is prepared and all responses are
scanned after-the-fact.

The back-and-forth mechanism is how the git-credential-manager tool would
use it, because it dynamically explores certain config keys. For example:
it checks the deepest possible URL for a specific key then peels away the
last segment of the URL to see if there is a directory-prefix match in a
key. (This is the main reason that there are so many requests in this
application.)

I believe this is similar to how 'git cat-file --batch' or 'git cat-file
--batch-check' work, which was my inspiration for this word. If we regret
those names, then I'm happy to move towards a better name.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help