From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: "Kristoffer Haugsbakk" <code@khaugsbakk.name>,
"Taylor Blau" <me@ttaylorr.com>,
"Jean-Noël AVILA" <jn.avila@free.fr>,
"Eric Sunshine" <sunshine@sunshineco.com>,
"Junio C Hamano" <gitster@pobox.com>,
"Dragan Simic" <dsimic@manjaro.org>,
rsbecker@nexbridge.com
Subject: [PATCH v5 00/14] builtin/config: introduce subcommands
Date: Mon, 6 May 2024 10:55:51 +0200 [thread overview]
Message-ID: <cover.1714982328.git.ps@pks.im> (raw)
In-Reply-To: <cover.1709724089.git.ps@pks.im>
[-- Attachment #1: Type: text/plain, Size: 5220 bytes --]
Hi,
this is the fifth and hopefully last version of my patch sthat
introduces subcommands into git-config(1).
The only changes compared to v4 are some fixes to commit messages.
Otherwise I'm not aware of any other feedback that would need to be
addressed.
Patrick
Patrick Steinhardt (14):
config: clarify memory ownership when preparing comment strings
builtin/config: move option array around
builtin/config: move "fixed-value" option to correct group
builtin/config: use `OPT_CMDMODE()` to specify modes
builtin/config: pull out function to handle config location
builtin/config: pull out function to handle `--null`
builtin/config: introduce "list" subcommand
builtin/config: introduce "get" subcommand
builtin/config: introduce "set" subcommand
builtin/config: introduce "unset" subcommand
builtin/config: introduce "rename-section" subcommand
builtin/config: introduce "remove-section" subcommand
builtin/config: introduce "edit" subcommand
builtin/config: display subcommand help
Documentation/git-config.txt | 219 ++++++++-------
builtin/config.c | 512 ++++++++++++++++++++++++++++-------
config.c | 16 +-
config.h | 2 +-
t/t0450/txt-help-mismatches | 1 -
t/t1300-config.sh | 432 +++++++++++++++++------------
6 files changed, 812 insertions(+), 370 deletions(-)
Range-diff against v4:
1: 3aa26d5bff ! 1: 881d2b5426 config: clarify memory ownership when preparing comment strings
@@ Commit message
not like this micro-optimization really matters. Thus, callers are now
always responsible for freeing the value.
+ Signed-off-by: Patrick Steinhardt <ps@pks.im>
+
## builtin/config.c ##
@@ builtin/config.c: static struct config_options config_options;
static int show_origin;
2: 8f0804ab48 = 2: 66dffaa8f2 builtin/config: move option array around
3: ddcd8031d7 ! 3: 36abda0e02 builtin/config: move "fixed-value" option to correct group
@@ Commit message
builtin/config: move "fixed-value" option to correct group
The `--fixed-value` option can be used to alter how the value-pattern
- parameter is interpreted for the various submodes of git-config(1). But
- while it is an option, it is currently listed as part of the submodes
- group the command, which is wrong.
+ parameter is interpreted for the various actions of git-config(1). But
+ while it is an option, it is currently listed as part of the actions
+ group, which is wrong.
Move the option to the "Other" group, which hosts the various options
known to git-config(1).
4: 1bc3918840 = 4: 34b66f9c87 builtin/config: use `OPT_CMDMODE()` to specify modes
5: 3754812309 = 5: 4f90f206e7 builtin/config: pull out function to handle config location
6: cb1714c493 = 6: df1a6f14e6 builtin/config: pull out function to handle `--null`
7: b3f3c3ba6a ! 7: 1df76a9970 builtin/config: introduce "list" subcommand
@@ Commit message
builtin/config: introduce "list" subcommand
While git-config(1) has several modes, those modes are not exposed with
- subcommands but instead by specifying e.g. `--unset` or `--list`. This
- user interface is not really in line with how our more modern commands
- work, where it is a lot more customary to say e.g. `git remote list`.
- Furthermore, to add to the confusion, git-config(1) also allows the user
- to request modes implicitly by just specifying the correct number of
- arguments. Thus, `git config foo.bar` will retrieve the value of
- "foo.bar" while `git config foo.bar baz` will set it to "baz".
+ subcommands but instead by specifying action flags like `--unset` or
+ `--list`. This user interface is not really in line with how our more
+ modern commands work, where it is a lot more customary to say e.g. `git
+ remote list`. Furthermore, to add to the confusion, git-config(1) also
+ allows the user to request modes implicitly by just specifying the
+ correct number of arguments. Thus, `git config foo.bar` will retrieve
+ the value of "foo.bar" while `git config foo.bar baz` will set it to
+ "baz".
Overall, this makes for a confusing interface that could really use a
makeover. It hurts discoverability of what you can do with git-config(1)
8: 0e6da909ac = 8: 29676b81e0 builtin/config: introduce "get" subcommand
9: 8a623a31b9 = 9: 94afb5a5b7 builtin/config: introduce "set" subcommand
10: e25e5b69cd = 10: e525c2326a builtin/config: introduce "unset" subcommand
11: f24008d356 = 11: a797889890 builtin/config: introduce "rename-section" subcommand
12: fc2ddd3201 = 12: 8ec214755e builtin/config: introduce "remove-section" subcommand
13: 4c2d817eff = 13: 1893c23afc builtin/config: introduce "edit" subcommand
14: 4c351b12b8 = 14: 97a48ab81d builtin/config: display subcommand help
base-commit: d4cc1ec35f3bcce816b69986ca41943f6ce21377
--
2.45.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-05-06 8:55 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 11:31 [PATCH 0/8] builtin/config: introduce subcommands Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 1/8] builtin/config: move option array around Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 2/8] builtin/config: move "fixed-value" option to correct group Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 3/8] builtin/config: use `OPT_CMDMODE()` to specify modes Patrick Steinhardt
2024-03-06 23:52 ` Taylor Blau
2024-03-07 7:02 ` Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 4/8] builtin/config: move modes into separate functions Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 5/8] builtin/config: track subcommands by action Patrick Steinhardt
2024-03-06 21:54 ` Jean-Noël AVILA
2024-03-07 6:37 ` Patrick Steinhardt
2024-03-07 0:10 ` Taylor Blau
2024-03-07 6:36 ` Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 6/8] builtin/config: introduce subcommands Patrick Steinhardt
2024-03-06 21:38 ` Karthik Nayak
2024-03-07 7:14 ` Patrick Steinhardt
2024-03-06 11:31 ` [PATCH 7/8] t1300: exercise both old- and new-style modes Patrick Steinhardt
2024-03-06 11:32 ` [PATCH 8/8] Documentation/git-config: update to new-style syntax Patrick Steinhardt
2024-03-07 6:57 ` Eric Sunshine
2024-03-07 7:33 ` Patrick Steinhardt
2024-03-06 17:06 ` [PATCH 0/8] builtin/config: introduce subcommands Junio C Hamano
2024-03-06 23:46 ` Taylor Blau
2024-03-06 23:52 ` Junio C Hamano
2024-03-07 0:13 ` Taylor Blau
2024-03-07 0:31 ` Dragan Simic
2024-03-07 6:31 ` Patrick Steinhardt
2024-03-07 13:22 ` Junio C Hamano
2024-03-06 22:49 ` Kristoffer Haugsbakk
2024-03-11 23:19 ` [PATCH v2 00/13] " Patrick Steinhardt
2024-03-11 23:19 ` [PATCH v2 01/13] builtin/config: move option array around Patrick Steinhardt
2024-03-11 23:19 ` [PATCH v2 02/13] builtin/config: move "fixed-value" option to correct group Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 03/13] builtin/config: use `OPT_CMDMODE()` to specify modes Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 04/13] builtin/config: pull out function to handle config location Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 05/13] builtin/config: pull out function to handle `--null` Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 06/13] builtin/config: introduce "list" subcommand Patrick Steinhardt
2024-03-13 2:45 ` Eric Sunshine
2024-03-27 8:42 ` Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 07/13] builtin/config: introduce "get" subcommand Patrick Steinhardt
2024-03-13 3:11 ` Eric Sunshine
2024-03-27 8:42 ` Patrick Steinhardt
2024-03-11 23:20 ` [PATCH v2 08/13] builtin/config: introduce "set" subcommand Patrick Steinhardt
2024-03-11 23:21 ` [PATCH v2 09/13] builtin/config: introduce "unset" subcommand Patrick Steinhardt
2024-03-11 23:21 ` [PATCH v2 10/13] builtin/config: introduce "rename-section" subcommand Patrick Steinhardt
2024-03-11 23:21 ` [PATCH v2 11/13] builtin/config: introduce "remove-section" subcommand Patrick Steinhardt
2024-03-11 23:21 ` [PATCH v2 12/13] builtin/config: introduce "edit" subcommand Patrick Steinhardt
2024-03-11 23:21 ` [PATCH v2 13/13] builtin/config: display subcommand help Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 00/13] builtin/config: introduce subcommands Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 01/13] builtin/config: move option array around Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 02/13] builtin/config: move "fixed-value" option to correct group Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 03/13] builtin/config: use `OPT_CMDMODE()` to specify modes Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 04/13] builtin/config: pull out function to handle config location Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 05/13] builtin/config: pull out function to handle `--null` Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 06/13] builtin/config: introduce "list" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 07/13] builtin/config: introduce "get" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 08/13] builtin/config: introduce "set" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 09/13] builtin/config: introduce "unset" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 10/13] builtin/config: introduce "rename-section" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 11/13] builtin/config: introduce "remove-section" subcommand Patrick Steinhardt
2024-03-27 8:46 ` [PATCH v3 12/13] builtin/config: introduce "edit" subcommand Patrick Steinhardt
2024-03-27 8:47 ` [PATCH v3 13/13] builtin/config: display subcommand help Patrick Steinhardt
2024-03-27 8:53 ` [PATCH v3 00/13] builtin/config: introduce subcommands Eric Sunshine
2024-03-27 9:16 ` Patrick Steinhardt
2024-05-03 9:56 ` [PATCH v4 00/14] " Patrick Steinhardt
2024-05-03 9:56 ` [PATCH v4 01/14] config: clarify memory ownership when preparing comment strings Patrick Steinhardt
2024-05-03 10:13 ` Kristoffer Haugsbakk
2024-05-03 9:56 ` [PATCH v4 02/14] builtin/config: move option array around Patrick Steinhardt
2024-05-03 9:56 ` [PATCH v4 03/14] builtin/config: move "fixed-value" option to correct group Patrick Steinhardt
2024-05-03 12:28 ` Karthik Nayak
2024-05-06 9:34 ` Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 04/14] builtin/config: use `OPT_CMDMODE()` to specify modes Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 05/14] builtin/config: pull out function to handle config location Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 06/14] builtin/config: pull out function to handle `--null` Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 07/14] builtin/config: introduce "list" subcommand Patrick Steinhardt
2024-05-03 13:08 ` Karthik Nayak
2024-05-03 13:13 ` rsbecker
2024-05-03 16:01 ` Junio C Hamano
2024-05-06 7:51 ` Patrick Steinhardt
2024-05-06 17:13 ` Junio C Hamano
2024-05-06 18:33 ` rsbecker
2024-05-06 18:45 ` Dragan Simic
2024-05-07 6:20 ` Kristoffer Haugsbakk
2024-05-06 21:33 ` Git 3.0? Junio C Hamano
2024-05-07 4:18 ` Patrick Steinhardt
2024-05-07 4:02 ` [PATCH v4 07/14] builtin/config: introduce "list" subcommand Patrick Steinhardt
2024-05-06 7:58 ` Patrick Steinhardt
2024-05-06 11:26 ` Karthik Nayak
2024-05-03 9:57 ` [PATCH v4 08/14] builtin/config: introduce "get" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 09/14] builtin/config: introduce "set" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 10/14] builtin/config: introduce "unset" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 11/14] builtin/config: introduce "rename-section" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 12/14] builtin/config: introduce "remove-section" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 13/14] builtin/config: introduce "edit" subcommand Patrick Steinhardt
2024-05-03 9:57 ` [PATCH v4 14/14] builtin/config: display subcommand help Patrick Steinhardt
2024-05-03 13:36 ` [PATCH v4 00/14] builtin/config: introduce subcommands Dragan Simic
2024-05-03 16:09 ` Junio C Hamano
2024-05-06 8:55 ` Patrick Steinhardt [this message]
2024-05-06 8:55 ` [PATCH v5 01/14] config: clarify memory ownership when preparing comment strings Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 02/14] builtin/config: move option array around Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 03/14] builtin/config: move "fixed-value" option to correct group Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 04/14] builtin/config: use `OPT_CMDMODE()` to specify modes Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 05/14] builtin/config: pull out function to handle config location Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 06/14] builtin/config: pull out function to handle `--null` Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 07/14] builtin/config: introduce "list" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 08/14] builtin/config: introduce "get" subcommand Patrick Steinhardt
2025-08-03 18:19 ` SZEDER Gábor
2025-08-03 22:30 ` Junio C Hamano
2025-09-11 11:05 ` Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 09/14] builtin/config: introduce "set" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 10/14] builtin/config: introduce "unset" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 11/14] builtin/config: introduce "rename-section" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 12/14] builtin/config: introduce "remove-section" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 13/14] builtin/config: introduce "edit" subcommand Patrick Steinhardt
2024-05-06 8:56 ` [PATCH v5 14/14] builtin/config: display subcommand help Patrick Steinhardt
2024-05-06 11:30 ` [PATCH v5 00/14] builtin/config: introduce subcommands Karthik Nayak
2024-05-06 20:21 ` Taylor Blau
2024-05-06 20:38 ` rsbecker
2024-05-07 4:07 ` Patrick Steinhardt
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=cover.1714982328.git.ps@pks.im \
--to=ps@pks.im \
--cc=code@khaugsbakk.name \
--cc=dsimic@manjaro.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jn.avila@free.fr \
--cc=me@ttaylorr.com \
--cc=rsbecker@nexbridge.com \
--cc=sunshine@sunshineco.com \
/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 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 NNTP newsgroup(s).