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

Re: Questions about trailer configuration semantics

From
Anders Waldenborg <anders@0x63.nu>
Date
Jul 27, 2020, 23:17 UTC
Message-ID
<87365cr1in.fsf@0x63.nu>
In-Reply-To
<xmqqa6zkfu3b.fsf@gitster.c.googlers.com>
Junio C Hamano writes:
> I had the same thought but then a question struck and stopped me:
> what should happen if "trailer.X.something" and
> "trailer.x.somethingelse" are both defined?
Good point.

If we follow the same reasoning as with what happens with prefix matching (config order matters) the one that happens to be mentioned first in configuration wins.

The same thing actually happens today with .key:

trailer.foo.key=Hello trailer.bar.key=HELLO

$ printf "\nHELLo: hi\n" | \
  git -c "trailer.foo.key=Hello" -c "trailer.bar.key=HELLO" interpret-trailers --parse
Hello: hi
but if we swap order of config:
$ printf "\nHELLo: hi\n" | \
  git -c "trailer.bar.key=HELLO" -c "trailer.foo.key=Hello" interpret-trailers --parse
HELLO: hi
Previous: Junio C HamanoNext: Christian Couder
Message 13 of 16 in “Questions about trailer configuration semantics”
  1. Anders WaldenborgJul 27, 2020
  2. Junio C HamanoJul 27, 2020
  3. Christian CouderJul 27, 2020
  4. Jeff KingJul 27, 2020
  5. Anders WaldenborgJul 27, 2020
  6. Jeff KingJul 27, 2020
  7. Junio C HamanoJul 27, 2020
  8. Anders WaldenborgJul 27, 2020
  9. Junio C HamanoJul 27, 2020
  10. Anders WaldenborgJul 28, 2020
  11. Anders WaldenborgJul 27, 2020
  12. Junio C HamanoJul 27, 2020
  13. Anders WaldenborgJul 27, 2020
  14. Christian CouderJul 28, 2020
  15. Jeff KingJul 28, 2020
  16. Junio C HamanoJul 28, 2020

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.