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

From: Junio C Hamano <[email-masked]>
Date: Thu, 28 May 2015 12:36:43 -0700

Junio C Hamano <[email-masked]> writes:

> 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