pr-git-2388/anpl1623/master-v8
tagged this
14 Sep 22:50
From: Andrew Pleeter <andrewpleeter@gmail.com> While 'git var' exposes GIT_AUTHOR_IDENT and GIT_COMMITTER_IDENT, extracting individual components (name, email, or date) currently requires callers to manually parse the composite string. Furthermore, there is no way to query the resolved commit signing key through 'git var', and the command only accepts a single variable at a time. Teach 'git var' to expose individual identity components and commit signing configuration, and allow querying multiple variables with optional NUL-termination: - Add GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and GIT_AUTHOR_DATE. - Add GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, and GIT_COMMITTER_DATE. - Add GIT_SIGNING_KEY to resolve the key that would be used to sign the resulting commit if you were to run 'git commit' right now. - Allow passing multiple variable arguments (e.g., 'git var GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL'). - When a single variable is requested, print its bare value for backward compatibility. - When multiple variables are requested, model the output after 'git var -l' by printing 'VARIABLE=value' pairs (or 'VARIABLE\nvalue\0' when '-z' is given). - Format multi-valued variables in multi-variable mode as repeated 'VARIABLE=value' entries (or 'VARIABLE\nvalue\0' with '-z'), eliminating stream ambiguity without extra trailing delimiters. - When querying multiple variables, omit any variable that has no value, continue processing remaining variables, and exit with code 1. - Support '-z' to terminate variable outputs with NUL bytes. - Format 'git var -l -z' using the same convention as 'git config list -z' (newline separating key and value, NUL separating entries). - Use parse_options() to strictly require options before arguments. - Update Documentation/git-var.adoc and t/t0007-git-var.sh. Signed-off-by: Andrew Pleeter <andrewpleeter@gmail.com> Submitted-As: https://lore.kernel.org/git/pull.2388.v8.git.git.1789426226860.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.git.git.1787690802942.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v2.git.git.1788220746663.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v3.git.git.1788403792962.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v4.git.git.1788840593177.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v5.git.git.1788900182711.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v6.git.git.1788917076554.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2388.v7.git.git.1789009798902.gitgitgadget@gmail.com