Git config `--stdin` flag
git config
does not allow for either batch operations, nor for reading values from standard in. Allowing setting values from stdin would be great as that would allow setting secrets leveraging git config
without leaking details through logging or other programs like ps
.
The idea for a --stdin
flag and the implementation is taken from git update-ref
:
With --stdin, update-ref reads instructions from standard input and performs all modifications together. Specify commands of the form: update SP <ref> SP <newvalue> [SP <oldvalue>] LF create SP <ref> SP <newvalue> LF delete SP <ref> [SP <oldvalue>] LF verify SP <ref> [SP <oldvalue>] LF option SP <opt> LF
I think in the case of config
, we could start with:
With --stdin, config reads instructions from standard input and performs all modifications in sequence. Specify commands of the form: get SP <key> LF set SP <key> SP <value> LF delete SP <key> LF
The interface is limited, as that seems to be a simpler interface to start with and allow for later backwards compatible changes.