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

[PATCH v7 2/2] fixup: config: add '--show-origin' option to print the origin of a config value

From
larsxschneider@gmail.com <larsxschneider@gmail.com>
Date
Feb 22, 2016, 09:23 UTC
Message-ID
<1456133026-15355-3-git-send-email-larsxschneider@gmail.com>
In-Reply-To
<1456133026-15355-1-git-send-email-larsxschneider@gmail.com>
From: Lars Schneider <larsxschneider@gmail.com>
---
 Documentation/git-config.txt | 5 +++--
 builtin/config.c             | 2 +-
 t/t1300-repo-config.sh       | 6 +++---
 3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 6374997..499fc0f 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -196,8 +196,9 @@ See also <<FILES>>.
 
 --show-origin::
 	Augment the output of all queried config options with the
-	origin type (file, stdin, blob, cmdline) and the actual origin
-	(config file path, ref, or blob id if applicable).
+	origin type (file, standard input, blob, command line) and
+	the actual origin (config file path, ref, or blob id if
+	applicable).
 
 --get-colorbool name [stdout-is-tty]::
 
diff --git a/builtin/config.c b/builtin/config.c
index a1a9b9a..0f14220 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -83,7 +83,7 @@ static struct option builtin_config_options[] = {
 	OPT_BOOL('z', "null", &end_null, N_("terminate values with NUL byte")),
 	OPT_BOOL(0, "name-only", &omit_values, N_("show variable names only")),
 	OPT_BOOL(0, "includes", &respect_includes, N_("respect include directives on lookup")),
-	OPT_BOOL(0, "show-origin", &show_origin, N_("show origin of config (file, stdin, blob, cmdline)")),
+	OPT_BOOL(0, "show-origin", &show_origin, N_("show origin of config (file, standard input, blob, command line)")),
 	OPT_END(),
 };
 
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 254643a..8867ce1 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -1246,7 +1246,7 @@ test_expect_success '--show-origin with --list' '
 		file:.git/config	user.override=local
 		file:.git/config	include.path=../include/relative.include
 		file:.git/../include/relative.include	user.relative=include
-		cmdline:	user.cmdline=true
+		command line:	user.cmdline=true
 	EOF
 	git -c user.cmdline=true config --list --show-origin >output &&
 	test_cmp expect output
@@ -1262,7 +1262,7 @@ test_expect_success '--show-origin with --list --null' '
 		trueQfile:.git/configQuser.override
 		localQfile:.git/configQinclude.path
 		../include/relative.includeQfile:.git/../include/relative.includeQuser.relative
-		includeQcmdline:Quser.cmdline
+		includeQcommand line:Quser.cmdline
 		trueQ
 	EOF
 	git -c user.cmdline=true config --null --list --show-origin >output.raw &&
@@ -1318,7 +1318,7 @@ test_expect_success '--show-origin escape special file name characters' '
 
 test_expect_success '--show-origin stdin' '
 	cat >expect <<-\EOF &&
-		stdin:	user.custom=true
+		standard input:	user.custom=true
 	EOF
 	git config --file - --show-origin --list <"$CUSTOM_CONFIG_FILE" >output &&
 	test_cmp expect output
-- 
2.5.1
Previous: larsxschneider@gmail.com
Message 17 of 17 in “config: add '--sources' option to print the source of a config value”
  1. 0/4 config: add '--sources' option to print the source of a config valuelarsxschneider@gmail.com, Feb 19, 2016
  2. 1/4 t: do not hide Git's exit code in tests using 'nul_to_q'larsxschneider@gmail.com, Feb 19, 2016
  3. 2/4 rename git_config_from_buf to git_config_from_memlarsxschneider@gmail.com, Feb 19, 2016
  4. 3/4 config: add 'origin_type' to config_source structlarsxschneider@gmail.com, Feb 19, 2016
  5. 4/4 config: add '--show-origin' option to print the origin of a config valuelarsxschneider@gmail.com, Feb 19, 2016
  6. Junio C HamanoFeb 22, 2016
  7. Jeff KingFeb 22, 2016
  8. Junio C HamanoFeb 22, 2016
  9. Johannes SixtMar 2, 2016
  10. Lars SchneiderMar 3, 2016
  11. Johannes SixtMar 3, 2016
  12. Johannes SchindelinMar 22, 2016
  13. Lars SchneiderMar 21, 2016
  14. Junio C HamanoFeb 19, 2016
  15. 0/2 config: add '--sources' option to print the source of a config valuelarsxschneider@gmail.com, Feb 22, 2016
  16. 1/2 fixup: config: add 'origin_type' to config_source structlarsxschneider@gmail.com, Feb 22, 2016
  17. 2/2 fixup: config: add '--show-origin' option to print the origin of a config valuelarsxschneider@gmail.com, Feb 22, 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.