Re: [PATCH 01/11] config-batch: basic boilerplate of new builtin
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Feb 5, 2026, 14:17 UTC
- Message-ID
- <6c8b984e-feda-48c6-b67d-80a41343bfc0@gmail.com>
- In-Reply-To
- <xmqq1pj0nleg.fsf@gitster.g>
On 2/4/2026 6:23 PM, Junio C Hamano wrote:
Show 18 quoted lines
> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes: > >> From: Derrick Stolee <stolee@gmail.com> >> >> 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 <stolee@gmail.com> >> --- > > 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