Skip to content

Conversation

@derrickstolee
Copy link

@derrickstolee derrickstolee commented Jan 17, 2026

TBD.

I have a test integration with git-credential-manager available [1] for testing.

[1] git-ecosystem/git-credential-manager#2245

Thanks,
-Stolee

cc: [email protected]

@derrickstolee derrickstolee force-pushed the batched-config branch 3 times, most recently from 78e771b to 59333ec Compare January 18, 2026 01:50
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 for some
CI builds to pass. Fix that oversight.

Signed-off-by: Derrick Stolee <[email protected]>
@derrickstolee derrickstolee force-pushed the batched-config branch 2 times, most recently from f4ae10d to 931fbf4 Compare January 18, 2026 03:40
@derrickstolee derrickstolee changed the title git-config-batch: a new builtin for tools reading config [RFC] git-config-batch: a new builtin for tools reading config Jan 18, 2026
return 0;

if (d->scope != CONFIG_SCOPE_UNKNOWN &&
d->scope != context->kvi->scope)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: --local will get things from worktree config, right? We should check to see if a function is needed here. --system and --global care about only one layer, but --local is more complicated, I think.

As we build new features in the config-batch command, we define the
plaintext protocol with line-by-line output and responses. To think to the
future, we make sure that the protocol has a clear way to respond to an
unknown command or an unknown version of that command.

Signed-off-by: Derrick Stolee <[email protected]>
The 'get' command for the 'git config-batch' builtin is the first command
and is currently at version 1. It returns at most one value, the same as
'git config --get <key>' with optional value-based filtering.

The documentation and tests detail the specifics of how to format requests
of this format and how to parse the results.

Future versions could consider multi-valued responses or regex-based key
matching.

For the sake of incremental exploration of the potential in the 'git
config-batch' command, this is the only implementation being presented in
the first patch series.

Future extensions could include a '-z' parameter that uses NUL bytes in the
command and output format to allow for spaces or newlines in the input or
newlines in the output.

Signed-off-by: Derrick Stolee <[email protected]>
Tools that use the 'git config-batch' tool will want to know which commands
are available in the current Git version. Having a 'help' command assists
greatly to give a clear set of available commands and their versions.

Signed-off-by: Derrick Stolee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant