git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v9 0/4] var: -z output, multiple variables, and broken-out idents

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 2, 2026, 14:11 UTC
Message-ID
<33f24834-8e73-4230-bf0a-6809a85d9a86@gmail.com>
In-Reply-To
<20260926162048.30853-1-andrewpleeter@gmail.com>
Hi Andrew
On 26/09/2026 17:20, Andrew Pleeter wrote:
Show 15 quoted lines
> This is a reroll of the single patch in v8, split up as Junio asked
> for, with the changes Phillip asked for on the list.
> 
> v8 was one commit doing four things at once. It is now four patches:
> 
>    1/4 converts the internal representation of a multi-valued variable
>        from a newline-joined string to a string_list, with no change in
>        output. Phillip suggested doing this as its own preparatory step.
> 
>    2/4 adds "-z", which is what forces the switch to parse_options(), so
>        that conversion lives here rather than in 1/4.
> 
>    3/4 teaches "git var" to take more than one variable.
> 
>    4/4 adds GIT_AUTHOR_NAME and friends.

These patches look good to me. I've left a comment on the tests in patches 3 and 4, but I'm not sure they are enough to warrant a re-roll.

Thanks for working on this, supporting multiple values and NUL termination are really useful improvements.

Phillip
Show 44 quoted lines
> Changes since v8:
> 
>   * GIT_SIGNING_KEY is dropped. Phillip asked three times how it was
>     meant to be used, and once I looked properly the answer was that the
>     value cannot be interpreted without also reading gpg.format, and that
>     in the default configuration it is a committer ident rather than a
>     key at all. I would rather leave it out than define a variable I
>     cannot describe. Details are in my reply to him on this thread.
> 
>   * Asking for several variables no longer exits non-zero just because
>     one of them has no value; such a variable is left out of the output
>     and the rest are still shown. A non-zero status is now reserved for
>     real errors, such as naming a variable that does not exist, so
>     callers can detect those from the exit code. A single variable still
>     exits 1 when it has no value, as before. This is Phillip's
>     GIT_CONFIG_NOSYSTEM point.
> 
>   * GIT_CONFIG_GLOBAL is documented as a variable that can have more than
>     one value.
> 
>   * The commit messages are prose rather than a list of bullet points,
>     and no longer narrate how the patch was developed.
> 
> The tests use nul_to_q rather than running test_cmp over files
> containing NUL bytes, which Phillip pointed out in v6. Each patch builds
> and passes t0007 on its own.
> 
> One thing I did not do, and would like an opinion on: for a multi-valued
> variable in multi-variable mode, rather than emitting a trailing
> delimiter, each value is shown as its own "VARIABLE=value" entry, which
> matches "git var -l". Phillip suggested the trailing delimiter and I am
> happy to switch.
> 
> Andrew Pleeter (4):
>    var: represent multi-valued variables with a string_list
>    var: add "-z" output mode
>    var: accept more than one variable
>    var: add broken-out identity variables
> 
>   Documentation/git-var.adoc |  68 +++++++++--
>   builtin/var.c              | 242 +++++++++++++++++++++++++++++--------
>   t/t0007-git-var.sh         | 153 +++++++++++++++++++++++
>   3 files changed, 403 insertions(+), 60 deletions(-)
> 
Previous: Andrew PleeterNext: Andrew Pleeter
Message 28 of 35 in “builtin/whoami: add new 'whoami' command”
  1. builtin/whoami: add new 'whoami' commandAndrew Pleeter via GitGitGadget, Aug 25, 2026
  2. brian m. carlsonAug 25, 2026
  3. Junio C HamanoAug 25, 2026
  4. builtin/ident: add new 'ident' commandAndrew Pleeter via GitGitGadget, Aug 31, 2026
  5. Jeff KingSep 1, 2026
  6. Junio C HamanoSep 1, 2026
  7. var: support broken-down idents, default key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 3, 2026
  8. Junio C HamanoSep 3, 2026
  9. Ben KnobleSep 3, 2026
  10. Phillip WoodSep 4, 2026
  11. Junio C HamanoSep 4, 2026
  12. Phillip WoodSep 8, 2026
  13. var: support broken-down idents, signing key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 8, 2026
  14. Phillip WoodSep 8, 2026
  15. var: support broken-down idents, signing key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 8, 2026
  16. Junio C HamanoSep 8, 2026
  17. var: support broken-down idents, signing key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 9, 2026
  18. Phillip WoodSep 9, 2026
  19. Junio C HamanoSep 9, 2026
  20. var: support broken-down idents, signing key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 10, 2026
  21. Junio C HamanoSep 14, 2026
  22. var: support broken-down idents, signing key, multiple args, and -zAndrew Pleeter via GitGitGadget, Sep 14, 2026
  23. Junio C HamanoSep 15, 2026
  24. Andrew PleeterSep 15, 2026
  25. Phillip WoodSep 22, 2026
  26. Andrew PleeterSep 26, 2026
  27. 0/4 var: -z output, multiple variables, and broken-out identsAndrew Pleeter, Sep 26, 2026
  28. Phillip WoodOct 2, 2026
  29. Andrew PleeterOct 2, 2026
  30. 1/4 var: represent multi-valued variables with a string_listAndrew Pleeter, Sep 26, 2026
  31. 2/4 var: add "-z" output modeAndrew Pleeter, Sep 26, 2026
  32. 3/4 var: accept more than one variableAndrew Pleeter, Sep 26, 2026
  33. Phillip WoodOct 2, 2026
  34. 4/4 var: add broken-out identity variablesAndrew Pleeter, Sep 26, 2026
  35. Phillip WoodOct 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.