git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/9] completion: avoid hard coding config var list
@ 2018-05-10 14:19 Nguyễn Thái Ngọc Duy
  2018-05-10 14:19 ` [PATCH 1/9] Add and use generic name->id mapping code for color slot parsing Nguyễn Thái Ngọc Duy
                   ` (11 more replies)
  0 siblings, 12 replies; 36+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2018-05-10 14:19 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

This is part of the attempt to automate more in git-completion.bash.
This series is about making 'git' binary provide the list of
recognized configuration variables and feeding it to git-completion.bash.

The approach is less than ideal. Unlike parse-options, we don't have a
reliable source for configuration variables. Instead, we go grep
config.txt for variable names.

This should work most of the time even if it might miss some variables
if we start to write funny things in config.txt. But compared to the
current approach "every now and then, manually go through config.txt
(or something) and update _git_config() function", this is still
definitely better.

The result is about 200 more completable options (from current 324).
Granted most of this is fsck message ids, but I'm sure it has picked
up a few good config variables and will continue so in the future.

While at there, this config list is also available to the user via
`git help --config` if you can't remember the exact config name you
want and don't want to go through that big git-config man page.

PS. Yes too many complete options (524 now) is not that helpful. I
have a plan to deal with this but probably after I'm done with the
--no-xxx completion topic. Stay tuned.

(on top of nd/command-list)

Nguyễn Thái Ngọc Duy (9):
  Add and use generic name->id mapping code for color slot parsing
  grep: keep all colors in an array
  fsck: factor out msg_id_info[] lazy initialization code
  help: add --config to list all available config
  advice: keep config name in camelCase in advice_config[]
  am: move advice.amWorkDir parsing back to advice.c
  completion: drop the hard coded list of config vars
  completion: support case-insensitive config vars just a bit
  log-tree: allow to customize 'grafted' color

 Documentation/config.txt               |   3 +-
 Documentation/git-help.txt             |   5 +
 advice.c                               |  51 ++--
 advice.h                               |   1 +
 builtin/am.c                           |   5 +-
 builtin/branch.c                       |  28 +-
 builtin/clean.c                        |  28 +-
 builtin/commit.c                       |  40 +--
 builtin/help.c                         |  14 +
 config.c                               |  13 +
 config.h                               |   4 +
 contrib/completion/git-completion.bash | 340 +------------------------
 diff.c                                 |  60 ++---
 fsck.c                                 |  49 ++--
 generate-cmdlist.sh                    |  20 ++
 grep.c                                 | 113 ++++----
 grep.h                                 |  21 +-
 help.c                                 |  74 ++++++
 help.h                                 |  18 ++
 log-tree.c                             |  36 +--
 t/t4254-am-corrupt.sh                  |   2 +-
 21 files changed, 387 insertions(+), 538 deletions(-)

-- 
2.17.0.705.g3525833791


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2018-05-29 17:41 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 14:19 [PATCH 0/9] completion: avoid hard coding config var list Nguyễn Thái Ngọc Duy
2018-05-10 14:19 ` [PATCH 1/9] Add and use generic name->id mapping code for color slot parsing Nguyễn Thái Ngọc Duy
2018-05-10 17:16   ` Stefan Beller
2018-05-11  7:22     ` Duy Nguyen
2018-05-10 14:19 ` [PATCH 2/9] grep: keep all colors in an array Nguyễn Thái Ngọc Duy
2018-05-10 14:19 ` [PATCH 3/9] fsck: factor out msg_id_info[] lazy initialization code Nguyễn Thái Ngọc Duy
2018-05-11 22:23   ` Eric Sunshine
2018-05-10 14:19 ` [PATCH 4/9] help: add --config to list all available config Nguyễn Thái Ngọc Duy
2018-05-11 22:39   ` Eric Sunshine
2018-05-10 14:19 ` [PATCH 5/9] advice: keep config name in camelCase in advice_config[] Nguyễn Thái Ngọc Duy
2018-05-10 14:19 ` [PATCH 6/9] am: move advice.amWorkDir parsing back to advice.c Nguyễn Thái Ngọc Duy
2018-05-11 22:42   ` Eric Sunshine
2018-05-10 14:19 ` [PATCH 7/9] completion: drop the hard coded list of config vars Nguyễn Thái Ngọc Duy
2018-05-11 22:47   ` Eric Sunshine
2018-05-20 16:01   ` SZEDER Gábor
2018-05-10 14:19 ` [PATCH 8/9] completion: support case-insensitive config vars just a bit Nguyễn Thái Ngọc Duy
2018-05-20 16:33   ` SZEDER Gábor
2018-05-10 14:19 ` [PATCH 9/9] log-tree: allow to customize 'grafted' color Nguyễn Thái Ngọc Duy
2018-05-10 14:22 ` [PATCH 0/9] completion: avoid hard coding config var list Duy Nguyen
2018-05-11  6:00 ` Junio C Hamano
2018-05-11  6:24   ` Duy Nguyen
2018-05-26 13:55 ` [PATCH v2 00/11] " Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 01/11] Add and use generic name->id mapping code for color slot parsing Nguyễn Thái Ngọc Duy
2018-05-29 17:41     ` Stefan Beller
2018-05-26 13:55   ` [PATCH v2 02/11] grep: keep all colors in an array Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 03/11] fsck: factor out msg_id_info[] lazy initialization code Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 04/11] help: add --config to list all available config Nguyễn Thái Ngọc Duy
2018-05-27  7:33     ` Eric Sunshine
2018-05-26 13:55   ` [PATCH v2 05/11] fsck: produce camelCase config key names Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 06/11] advice: keep config name in camelCase in advice_config[] Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 07/11] am: move advice.amWorkDir parsing back to advice.c Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 08/11] completion: drop the hard coded list of config vars Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 09/11] completion: keep other config var completion in camelCase Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 10/11] completion: support case-insensitive config vars Nguyễn Thái Ngọc Duy
2018-05-26 13:55   ` [PATCH v2 11/11] log-tree: allow to customize 'grafted' color Nguyễn Thái Ngọc Duy
2018-05-27 18:28     ` [PATCH v2 12/11] completion: complete general config vars in two steps Nguyễn Thái Ngọc Duy

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).