git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] config: add '--sources' option to print the source of a config value
@ 2016-02-13 14:24 larsxschneider
  2016-02-13 14:24 ` [PATCH v3 1/3] git-config.txt: describe '--includes' default behavior larsxschneider
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: larsxschneider @ 2016-02-13 14:24 UTC (permalink / raw)
  To: git; +Cc: peff, sschuberth, ramsay, sunshine, hvoigt, sbeller,
	Lars Schneider

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".

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2016-02-15  9:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-13 14:24 [PATCH v3 0/3] config: add '--sources' option to print the source of a config value larsxschneider
2016-02-13 14:24 ` [PATCH v3 1/3] git-config.txt: describe '--includes' default behavior larsxschneider
2016-02-13 17:17   ` Jeff King
2016-02-13 21:00     ` Junio C Hamano
2016-02-14  0:34       ` Jeff King
2016-02-14 12:17     ` Lars Schneider
2016-02-14 16:05       ` Jeff King
2016-02-13 14:24 ` [PATCH v3 2/3] config: add 'type' to config_source struct that identifies config type larsxschneider
2016-02-13 17:24   ` Jeff King
2016-02-13 21:04     ` Junio C Hamano
2016-02-14 12:26       ` Lars Schneider
2016-02-14 12:24     ` Lars Schneider
2016-02-14 16:07       ` Jeff King
2016-02-13 14:24 ` [PATCH v3 3/3] config: add '--show-origin' option to print the origin of a config value larsxschneider
2016-02-13 17:44   ` Jeff King
2016-02-13 18:04     ` Jeff King
2016-02-13 18:15       ` Jeff King
2016-02-15  9:41         ` Lars Schneider
2016-02-14 12:48     ` Lars Schneider
2016-02-14 16:18       ` Jeff King
2016-02-15  7:53         ` Johannes Schindelin
2016-02-13 14:43 ` [PATCH v3 0/3] config: add '--sources' option to print the source " Mike Rappazzo
2016-02-13 17:26   ` Sebastian Schuberth
2016-02-13 18:19   ` Jeff King
2016-02-13 21:05     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).