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

Re: [PATCH v2 1/2] config: add options to list only variable names

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2015, 19:36 UTC
Message-ID
<xmqq7frsh4tw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqbnh4h5k4.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> The 'type' may also be shared between these two options, no?  It
> would be logically consistent if you can say
>
> 	git config --bool --get-name-regexp '.*' 'no'
>
> to find all configuration variables that are set to 'false' in
> different spellings like '0', 'false', 'no', etc.  And I suspect
> that the code already supports that.

Not really. This of course inherits the same breakage from the existing --get-regexp code in that the value part is still matched as string. I am sure you could argue that "but read the name of the last optional argument; it says value_REGEX and it is clearly about matching textually", and it may technically not be incorrect per-se, but I'd say it is merely a justification for a lazy implementation to defend the current less-than-useful behaviour.

In any case, because it is still a textual match, user.name='Junio Hamano' matches with the above. The only reason why it does not barf is because it does not try to interpret and format that value as a boolean.

So I would say that the feature supports [type] and [value_regex] to exactly the same degree as --get-regexp, i.e. with breakage.

Which means we should document it the same way, even though both are equally broken. So that other people can later visit it and correct the issue for both options.

-- >8 --
Subject: [PATCH] SQUASH???
The new option --get-name-regexp is a variant of --get-regexp; show
them next to each other, and also document [type] and [value_regex]
that the option seems to support.
---
 Documentation/git-config.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index b69c859..9fc78d8 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -15,8 +15,8 @@ SYNOPSIS
 'git config' [<file-option>] [type] [-z|--null] --get name [value_regex]
 'git config' [<file-option>] [type] [-z|--null] --get-all name [value_regex]
 'git config' [<file-option>] [type] [-z|--null] --get-regexp name_regex [value_regex]
+'git config' [<file-option>] [type] [-z|--null] --get-name-regexp name_regex [value_regex]
 'git config' [<file-option>] [type] [-z|--null] --get-urlmatch name URL
-'git config' [<file-option>] [-z|--null] --get-name-regexp name_regex
 'git config' [<file-option>] --unset name [value_regex]
 'git config' [<file-option>] --unset-all name [value_regex]
 'git config' [<file-option>] --rename-section old_name new_name
-- 
2.4.2-521-g2db3d00
Previous: Junio C HamanoNext: Christian Couder
Message 13 of 17 in “config: add options to list only variable names”
  1. 1/2 config: add options to list only variable namesSZEDER Gábor, May 27, 2015
  2. 2/2 completion: use new 'git config' options to reliably list variable namesSZEDER Gábor, May 27, 2015
  3. 5/2 config: add options to list only variable namesSZEDER Gábor, May 27, 2015
  4. Christian CouderMay 28, 2015
  5. Jeff KingMay 27, 2015
  6. Jeff KingMay 27, 2015
  7. Jeff KingMay 27, 2015
  8. SZEDER GáborMay 27, 2015
  9. Junio C HamanoMay 27, 2015
  10. 0/2 config: list only variable names for completionSZEDER Gábor, May 28, 2015
  11. 1/2 config: add options to list only variable namesSZEDER Gábor, May 28, 2015
  12. Junio C HamanoMay 28, 2015
  13. Junio C HamanoMay 28, 2015
  14. Christian CouderMay 29, 2015
  15. Jeff KingMay 29, 2015
  16. 2/2 completion: use new 'git config' options to reliably list variable namesSZEDER Gábor, May 28, 2015
  17. Jeff KingMay 28, 2015

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.