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

Re: [PATCH v3 0/3] config: add '--sources' option to print the source of a config value

From
Mike Rappazzo <rappazzo@gmail.com>
Date
Feb 13, 2016, 14:43 UTC
Message-ID
<CANoM8SWj08qKvDXhyfRXLV2iuYJ7Vjdutzjt0Q2ZNOcProqy=Q@mail.gmail.com>
In-Reply-To
<1455373456-64691-1-git-send-email-larsxschneider@gmail.com>
On Sat, Feb 13, 2016 at 9:24 AM,  <larsxschneider@gmail.com> wrote:
Show 20 quoted lines
> From: Lars Schneider <larsxschneider@gmail.com>
>
> diff to v2:
> * rename cmd to cmdline
> * rename function current_config_name to current_config_type_name
> * add 'type' to config_source struct that identifies config type
> * fix config stdin error output and add test case "invalid stdin config"
> * change delimiter between type and name from tab to colon
> * remove is_query_action variable
> * rename "--sources" to "--show-origin"
> * add pathological test case "--show-origin stdin with file include"
> * enumerate all valid commandline cases for "--show-origin"
> * removed TODOs as there are no config include bugs
> * describe '--includes' default behavior in git-config.txt
> * split test cases
> * use non-interpolated here-docs where possible
> * improve readablity of 'show_config_origin' function by removing duality
>
> I renamed the flag from "--source" to "--show-origin" as I got the impression
> that Sebastian, Peff and Ramsay seem to be all OK with "--show-origin".

I know that I am late to the party here, but why not make the option `--verbose` or `-v`? `git config` doesn't have that now, and this seems like a logical thing to include as verbose data. I would venture to guess that `--verbose` is more likely to be the first thing that someone who is looking for this information will guess at before they run `git config --help`.

Show 40 quoted lines
>
> Thanks Eric for the hint to simplify the 'show_config_origin' function.
> I took your suggestion but modfied one line. Instead of "fputs" I used
> "fwrite" to write the content. This was necssary as the last char of the
> string could be \0 due to the "--null" flag. "fputs" would ignore that.
>
> In 959b545 Heiko introduced a config API to lookup .gitmodules values and
> in "submodule-config.c" he uses the "git_config_from_buf" function [1]. I
> wonder if my modifications to this function could trigger any unwanted side
> effects in his implementation? (I can't imagine any but I want to make you
> aware of this connection)
>
>
> Thanks a lot Peff, Sebastian, Ramsey, and Eric for the review.
>
>
> [1] https://github.com/git/git/blob/494398473714dcbedb38b1ac79b531c7384b3bc4/submodule-config.c#L430-L431
>
>
> Lars Schneider (3):
>   git-config.txt: describe '--includes' default behavior
>   config: add 'type' to config_source struct that identifies config type
>   config: add '--show-origin' option to print the origin of a config
>     value
>
>  Documentation/git-config.txt |  19 ++++--
>  builtin/config.c             |  35 +++++++++++
>  cache.h                      |   1 +
>  config.c                     |  23 +++++---
>  t/t1300-repo-config.sh       | 136 ++++++++++++++++++++++++++++++++++++++++++-
>  t/t1308-config-set.sh        |   4 +-
>  6 files changed, 202 insertions(+), 16 deletions(-)
>
> --
> 2.5.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Johannes SchindelinNext: Sebastian Schuberth
Message 22 of 25 in “config: add '--sources' option to print the source of a config value”
  1. 0/3 config: add '--sources' option to print the source of a config valuelarsxschneider@gmail.com, Feb 13, 2016
  2. 1/3 git-config.txt: describe '--includes' default behaviorlarsxschneider@gmail.com, Feb 13, 2016
  3. Jeff KingFeb 13, 2016
  4. Junio C HamanoFeb 13, 2016
  5. Jeff KingFeb 14, 2016
  6. Lars SchneiderFeb 14, 2016
  7. Jeff KingFeb 14, 2016
  8. 2/3 config: add 'type' to config_source struct that identifies config typelarsxschneider@gmail.com, Feb 13, 2016
  9. Jeff KingFeb 13, 2016
  10. Junio C HamanoFeb 13, 2016
  11. Lars SchneiderFeb 14, 2016
  12. Lars SchneiderFeb 14, 2016
  13. Jeff KingFeb 14, 2016
  14. 3/3 config: add '--show-origin' option to print the origin of a config valuelarsxschneider@gmail.com, Feb 13, 2016
  15. Jeff KingFeb 13, 2016
  16. Jeff KingFeb 13, 2016
  17. Jeff KingFeb 13, 2016
  18. Lars SchneiderFeb 15, 2016
  19. Lars SchneiderFeb 14, 2016
  20. Jeff KingFeb 14, 2016
  21. Johannes SchindelinFeb 15, 2016
  22. Mike RappazzoFeb 13, 2016
  23. Sebastian SchuberthFeb 13, 2016
  24. Jeff KingFeb 13, 2016
  25. Junio C HamanoFeb 13, 2016

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.