diff options
author | SZEDER Gábor <szeder@ira.uka.de> | 2015-08-10 11:46:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-10 10:34:40 -0700 |
commit | 905f2036d0975a828f764947384e732c2908d6eb (patch) | |
tree | aa75cb3cb37e9d9da336dc147073872f05c8d334 /archive.c | |
parent | 578625fa918922713a2ecce2b06611e4566778f5 (diff) | |
download | git-905f2036d0975a828f764947384e732c2908d6eb.tar.gz git-905f2036d0975a828f764947384e732c2908d6eb.tar.xz |
completion: list variable names reliably with 'git config --name-only'
Recenty I created a multi-line branch description with '.' and '='
characters on one of the lines, and noticed that fragments of that line
show up when completing set variable names for 'git config', e.g.:
$ git config --get branch.b.description
Branch description to fool the completion script with a
second line containing dot . and equals = characters.
$ git config --unset <TAB>
...
second line containing dot . and equals
...
The completion script runs 'git config --list' and processes its output
to strip the values and keep only the variable names. It does so by
looking for lines containing '.' and '=' and outputting everything
before the '=', which was fooled by my multi-line branch description.
A similar issue exists with aliases and pretty format aliases with
multi-line values, but in that case 'git config --get-regexp' is run and
lines in its output are simply stripped after the first space, so
subsequent lines don't even have to contain '.' and '=' to fool the
completion script.
Use the new '--name-only' option added in the previous commit to list
config variable names reliably in both cases, without error-prone post
processing.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.c')
0 files changed, 0 insertions, 0 deletions