git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: larsxschneider@gmail.com
To: git@vger.kernel.org
Cc: peff@peff.net, sschuberth@gmail.com, ramsay@ramsayjones.plus.com,
	sunshine@sunshineco.com, hvoigt@hvoigt.net, sbeller@google.com,
	Lars Schneider <larsxschneider@gmail.com>
Subject: [PATCH v3 0/3] config: add '--sources' option to print the source of a config value
Date: Sat, 13 Feb 2016 15:24:13 +0100	[thread overview]
Message-ID: <1455373456-64691-1-git-send-email-larsxschneider@gmail.com> (raw)

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

             reply	other threads:[~2016-02-13 14:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13 14:24 larsxschneider [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455373456-64691-1-git-send-email-larsxschneider@gmail.com \
    --to=larsxschneider@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    --cc=peff@peff.net \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=sbeller@google.com \
    --cc=sschuberth@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).