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

Re: [PATCH] interpret-trailers: load default config

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 19, 2019, 14:24 UTC
Message-ID
<xmqqwohhr6ut.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190619033728.GA29027@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> Subject: [PATCH] interpret-trailers: load default config
>
> The interpret-trailers program does not do the usual loading of config
> via git_default_config(), and thus does not respect many of the usual
> options. In particular, we will not load core.commentChar, even though
> the underlying trailer code tries to do so.

"tries to use it"? Eh, it does use it, so, "the underlying trailer code uses its value", would be the correct version of the last sentence.

The underlying trailer.c has two calls to git_config() to lazy-load its own set of config variables (which is justified, as its caller is not necessarily the "interpret-trailers" subcommand), but their callbacks are not good places to call git_default_config() from for obvious reasons. It has to be done in "interpret-trailers" (and other callers of the machinery should already have learned what core.commentChar is with their own configuration calls) like the patch I am reviewing does.

Looks perfect.  Thanks.
Show 7 quoted lines
> This can be seen in the accompanying test, where setting
> core.commentChar to anything besides "#" results in a failure to treat
> the comments correctly.
>
> Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  builtin/interpret-trailers.c  |  3 ++
>  t/t7513-interpret-trailers.sh | 70 +++++++++++++++++++++--------------
>  2 files changed, 46 insertions(+), 27 deletions(-)
Previous: Jeff KingNext: Jeff King
Message 10 of 13 in “'git interpret-trailers' is tripped by comment characters other than '#'”
  1. Masahiro YamadaJun 14, 2019
  2. Jeff KingJun 14, 2019
  3. Christian CouderJun 15, 2019
  4. Masahiro YamadaJun 17, 2019
  5. Christian CouderJun 17, 2019
  6. Junio C HamanoJun 17, 2019
  7. Christian CouderJun 17, 2019
  8. Masahiro YamadaJun 18, 2019
  9. interpret-trailers: load default configJeff King, Jun 19, 2019
  10. Junio C HamanoJun 19, 2019
  11. Jeff KingJun 19, 2019
  12. Masahiro YamadaJun 19, 2019
  13. Masahiro YamadaJun 17, 2019

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.