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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 27, 2015, 22:20 UTC
Message-ID
<xmqqd21lk6h2.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1432757240-4445-1-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 9 quoted lines
> diff --git a/builtin/config.c b/builtin/config.c
> index 7188405..38bcf83 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -13,6 +13,7 @@ static char *key;
>  static regex_t *key_regexp;
>  static regex_t *regexp;
>  static int show_keys;
> +static int show_only_keys;

Is it just me who thinks this is a strange phrase? Somehow these words do not roll well on my tongue.

Perhaps "static int omit_values"? Which would match what this part does pretty well:

>  static int show_all_config(const char *key_, const char *value_, void *cb)
>  {
> -	if (value_)
> +	if (!show_only_keys && value_)
That is, "if not omitting values and there is a value, then do this".
Show 7 quoted lines
> -	return format_config(&values->items[values->nr++], key_, value_);
> +	if (show_only_keys) {
> +		struct strbuf *buf = &values->items[values->nr++];
> +		strbuf_init(buf, 0);
> +		strbuf_addstr(buf, key_);
> +		strbuf_addch(buf, term);
> +		return 0;
xstrfmt()?
Previous: SZEDER GáborNext: SZEDER Gábor
Message 9 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.