From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] config: add options to list only variable names
Date: Wed, 27 May 2015 15:20:41 -0700 [thread overview]
Message-ID: <xmqqd21lk6h2.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1432757240-4445-1-git-send-email-szeder@ira.uka.de> ("SZEDER Gábor"'s message of "Wed, 27 May 2015 22:07:19 +0200")
SZEDER Gábor <szeder@ira.uka.de> writes:
> 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".
> - 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()?
next prev parent reply other threads:[~2015-05-27 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 20:07 [PATCH 1/2] config: add options to list only variable names SZEDER Gábor
2015-05-27 20:07 ` [PATCH 2/2] completion: use new 'git config' options to reliably list " SZEDER Gábor
2015-05-27 20:11 ` [PATCH 1.5/2] config: add options to list only " SZEDER Gábor
2015-05-28 12:06 ` Christian Couder
2015-05-27 21:05 ` [PATCH 2/2] completion: use new 'git config' options to reliably list " Jeff King
2015-05-27 21:04 ` [PATCH 1/2] config: add options to list only " Jeff King
2015-05-27 21:08 ` Jeff King
2015-05-27 21:34 ` SZEDER Gábor
2015-05-27 22:20 ` Junio C Hamano [this message]
2015-05-28 12:29 ` [PATCH v2 0/2] config: list only variable names for completion SZEDER Gábor
2015-05-28 12:29 ` [PATCH v2 1/2] config: add options to list only variable names SZEDER Gábor
2015-05-28 19:20 ` Junio C Hamano
2015-05-28 19:36 ` Junio C Hamano
2015-05-29 11:34 ` Christian Couder
2015-05-29 11:39 ` Jeff King
2015-05-28 12:29 ` [PATCH v2 2/2] completion: use new 'git config' options to reliably list " SZEDER Gábor
2015-05-28 20:39 ` [PATCH v2 0/2] config: list only variable names for completion Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqd21lk6h2.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=szeder@ira.uka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.