Re: [PATCH 1/2] config: add options to list only variable names
From: SZEDER Gábor <hidden>
Date: 2016-06-15 23:05:01
Quoting Jeff King [off-list ref]:
On Wed, May 27, 2015 at 10:07:19PM +0200, SZEDER Gábor wrote:quoted
Help the completion script by introducing the '--list-names' and '--get-names-regexp' options, the "names-only" equivalents of '--list' and '--get-regexp', so it doesn't have to separate variable names from their values anymore.Thanks, this sounds like the best solution. It should be a tiny bit more efficient, too, though I doubt it matters much in practice.quoted
-'git config' [<file-option>] [-z|--null] -l | --list +'git config' [<file-option>] [-z|--null] -l | --list | --list-names/list-name/&s/, to match the code (and your commit message).
And note how I added an extra 's' to the other option in the commit message!
quoted
cat > expect << EOF +beta.noindent +nextsection.nonewline +123456.a123 +version.1.2.3eX.alpha +EOF + +test_expect_success 'working --list-names' ' + git config --list-names > output && + test_cmp expect output +' + +cat > expect << EOFWe usually avoid the extra space after redirection operators. But we also usually match existing code. I'm not sure which is more evil in this case. ;)quoted
+test_expect_success '--get-name-regexp' ' + git config --get-name-regexp in >output && + test_cmp expect output +'This one is the odd man out if you are following existing style, though.
Heh, in both cases I simply copied the existing "name-less" test, and only adjusted the expected output and the name of the option to test. :) Will reroll. Gábor