git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Christian Couder <christian.couder@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCHv3 1/2] config: add '--names-only' option to list only variable names
Date: Mon, 10 Aug 2015 09:41:24 -0400	[thread overview]
Message-ID: <20150810134124.GA6763@sigill.intra.peff.net> (raw)
In-Reply-To: <1439199967-9655-2-git-send-email-szeder@ira.uka.de>

On Mon, Aug 10, 2015 at 11:46:06AM +0200, SZEDER Gábor wrote:

> 'git config' can only show values or name-value pairs, so if a shell
> script needs the names of set config variables it has to run 'git config
> --list' or '--get-regexp' and parse the output to separate config
> variable names from their values.  However, such a parsing can't cope
> with multi-line values.  Though 'git config' can produce null-terminated
> output for newline-safe parsing, that's of no use in such a case, becase
> shells can't cope with null characters.
> 
> Even our own bash completion script suffers from these issues.
> 
> Help the completion script, and shell scripts in general, by introducing
> the '--names-only' option to modify the output of '--list' and
> '--get-regexp' to list only the names of config variables, so they don't
> have to perform error-prone post processing to separate variable names
> from their values anymore.

Nice. The whole thing looks very neatly done. I have only one minor nit:
the option "--names-only" is _almost_ the same as the "--name-only" diff
option which is somewhat similar. Obviously they do different things and
do not need to match, but I wonder if it would create less annoyance to
just give them the same name.

-Peff

  reply	other threads:[~2015-08-10 13:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10  9:46 [PATCHv3 0/2] 'git config --names-only' to help the completion script SZEDER Gábor
2015-08-10  9:46 ` [PATCHv3 1/2] config: add '--names-only' option to list only variable names SZEDER Gábor
2015-08-10 13:41   ` Jeff King [this message]
2015-08-10 17:18   ` Junio C Hamano
2015-08-12 23:47     ` SZEDER Gábor
2015-08-13  1:39       ` Junio C Hamano
2015-08-20 14:14         ` [PATCH] config: restructure format_config() for better control flow SZEDER Gábor
2015-08-20 14:45           ` Jeff King
2015-08-20 14:46             ` [PATCH 1/3] format_config: don't init strbuf Jeff King
2015-08-20 14:47             ` [PATCH 2/3] format_config: simplify buffer handling Jeff King
2015-08-21 11:52               ` SZEDER Gábor
2015-08-21 17:42               ` Junio C Hamano
2015-08-21 17:43                 ` Junio C Hamano
2015-08-21 19:40                   ` Jeff King
2015-08-20 14:49             ` [PATCH 3/3] get_urlmatch: avoid useless strbuf write Jeff King
2015-08-20 20:19             ` [PATCH] config: restructure format_config() for better control flow Junio C Hamano
2015-08-10  9:46 ` [PATCHv3 2/2] completion: list variable names reliably with 'git config --names-only' SZEDER Gábor
2015-08-10 13:45   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150810134124.GA6763@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).