git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/8] builtin/config: move modes into separate functions

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 6, 2024, 11:31 UTC
Message-ID
<b258f31b7d9d7bb104175b7dedc3e13506cea9e9.1709724089.git.ps@pks.im>
In-Reply-To
<cover.1709724089.git.ps@pks.im>

The git-config(1) command has several different modes which cause it to do different things. The logic for each of these modes is hosted in a giant switch in `cmd_config()` itself. For one, this is hard to read. But second, we're about to introduce proper subcommands to git-config(1) that will require separate functions for each of the modes.

Refactor the code and move each mode into its own function to prepare for this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 builtin/config.c | 410 +++++++++++++++++++++++++++++------------------
 1 file changed, 255 insertions(+), 155 deletions(-)
diff --git a/builtin/config.c b/builtin/config.c
index 8a2d1a5de7..a6ab9b8204 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -44,6 +44,7 @@ static struct config_options config_options;
 static int show_origin;
 static int show_scope;
 static int fixed_value;
+static int config_flags;
 
 #define ACTION_GET (1<<0)
 #define ACTION_GET_ALL (1<<1)
@@ -622,6 +623,225 @@ static char *default_user_config(void)
 	return strbuf_detach(&buf, NULL);
 }
 
+static int cmd_config_list(int argc, const char **argv, const char *prefix)
+{
+	check_argc(argc, 0, 0);
+	if (config_with_options(show_all_config, NULL,
+				&given_config_source, the_repository,
+				&config_options) < 0) {
+		if (given_config_source.file)
+			die_errno(_("unable to read config file '%s'"),
+				  given_config_source.file);
+		else
+			die(_("error processing config file(s)"));
+	}
+
+	return 0;
+}
+
+static int cmd_config_edit(int argc, const char **argv, const char *prefix)
+{
+	char *config_file;
+
+	check_argc(argc, 0, 0);
+	if (!given_config_source.file && !startup_info->have_repository)
+		die(_("not in a git directory"));
+	if (given_config_source.use_stdin)
+		die(_("editing stdin is not supported"));
+	if (given_config_source.blob)
+		die(_("editing blobs is not supported"));
+	git_config(git_default_config, NULL);
+	config_file = given_config_source.file ?
+			xstrdup(given_config_source.file) :
+			git_pathdup("config");
+	if (use_global_config) {
+		int fd = open(config_file, O_CREAT | O_EXCL | O_WRONLY, 0666);
+		if (fd >= 0) {
+			char *content = default_user_config();
+			write_str_in_full(fd, content);
+			free(content);
+			close(fd);
+		}
+		else if (errno != EEXIST)
+			die_errno(_("cannot create configuration file %s"), config_file);
+	}
+	launch_editor(config_file, NULL, NULL);
+	free(config_file);
+
+	return 0;
+}
+
+static int cmd_config_set(int argc, const char **argv, const char *prefix)
+{
+	struct key_value_info default_kvi = KVI_INIT;
+	char *value = NULL;
+	int ret;
+
+	check_write();
+	check_argc(argc, 2, 2);
+	value = normalize_value(argv[0], argv[1], &default_kvi);
+	ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
+	if (ret == CONFIG_NOTHING_SET)
+		error(_("cannot overwrite multiple values with a single value\n"
+		"       Use a regexp, --add or --replace-all to change %s."), argv[0]);
+
+	free(value);
+	return ret;
+}
+
+static int cmd_config_set_all(int argc, const char **argv, const char *prefix)
+{
+	struct key_value_info default_kvi = KVI_INIT;
+	char *value = NULL;
+	int ret;
+
+	check_write();
+	check_argc(argc, 2, 3);
+	value = normalize_value(argv[0], argv[1], &default_kvi);
+	ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+						     argv[0], value, argv[2],
+						     config_flags);
+
+	free(value);
+	return ret;
+}
+
+static int cmd_config_add(int argc, const char **argv, const char *prefix)
+{
+	struct key_value_info default_kvi = KVI_INIT;
+	char *value = NULL;
+	int ret;
+
+	check_write();
+	check_argc(argc, 2, 2);
+	value = normalize_value(argv[0], argv[1], &default_kvi);
+	ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+						     argv[0], value,
+						     CONFIG_REGEX_NONE,
+						     config_flags);
+
+	free(value);
+	return ret;
+}
+
+static int cmd_config_replace_all(int argc, const char **argv, const char *prefix)
+{
+	struct key_value_info default_kvi = KVI_INIT;
+	char *value = NULL;
+	int ret;
+
+	check_write();
+	check_argc(argc, 2, 3);
+	value = normalize_value(argv[0], argv[1], &default_kvi);
+	ret = git_config_set_multivar_in_file_gently(given_config_source.file,
+						     argv[0], value, argv[2],
+						     config_flags | CONFIG_FLAGS_MULTI_REPLACE);
+
+	free(value);
+	return ret;
+}
+
+static int cmd_config_get(int argc, const char **argv, const char *prefix)
+{
+	check_argc(argc, 1, 2);
+	return get_value(argv[0], argv[1], config_flags);
+}
+
+static int cmd_config_get_all(int argc, const char **argv, const char *prefix)
+{
+	do_all = 1;
+	check_argc(argc, 1, 2);
+	return get_value(argv[0], argv[1], config_flags);
+}
+
+static int cmd_config_get_regexp(int argc, const char **argv, const char *prefix)
+{
+	show_keys = 1;
+	use_key_regexp = 1;
+	do_all = 1;
+	check_argc(argc, 1, 2);
+	return get_value(argv[0], argv[1], config_flags);
+}
+
+static int cmd_config_get_urlmatch(int argc, const char **argv, const char *prefix)
+{
+	check_argc(argc, 2, 2);
+	return get_urlmatch(argv[0], argv[1]);
+}
+
+static int cmd_config_unset(int argc, const char **argv, const char *prefix)
+{
+	check_write();
+	check_argc(argc, 1, 2);
+	if (argc == 2)
+		return git_config_set_multivar_in_file_gently(given_config_source.file,
+							      argv[0], NULL, argv[1],
+							      config_flags);
+	else
+		return git_config_set_in_file_gently(given_config_source.file,
+						     argv[0], NULL);
+}
+
+static int cmd_config_unset_all(int argc, const char **argv, const char *prefix)
+{
+	check_write();
+	check_argc(argc, 1, 2);
+	return git_config_set_multivar_in_file_gently(given_config_source.file,
+						      argv[0], NULL, argv[1],
+						      config_flags | CONFIG_FLAGS_MULTI_REPLACE);
+}
+
+static int cmd_config_rename_section(int argc, const char **argv, const char *prefix)
+{
+	int ret;
+
+	check_write();
+	check_argc(argc, 2, 2);
+	ret = git_config_rename_section_in_file(given_config_source.file,
+						argv[0], argv[1]);
+	if (ret < 0)
+		return ret;
+	else if (!ret)
+		die(_("no such section: %s"), argv[0]);
+	else
+		ret = 0;
+
+	return ret;
+}
+
+static int cmd_config_remove_section(int argc, const char **argv, const char *prefix)
+{
+	int ret;
+
+	check_write();
+	check_argc(argc, 1, 1);
+	ret = git_config_rename_section_in_file(given_config_source.file,
+						argv[0], NULL);
+	if (ret < 0)
+		return ret;
+	else if (!ret)
+		die(_("no such section: %s"), argv[0]);
+	else
+		ret = 0;
+
+	return ret;
+}
+
+static int cmd_config_get_color(int argc, const char **argv, const char *prefix)
+{
+	check_argc(argc, 1, 2);
+	get_color(argv[0], argv[1]);
+	return 0;
+}
+
+static int cmd_config_get_colorbool(int argc, const char **argv, const char *prefix)
+{
+	check_argc(argc, 1, 2);
+	if (argc == 2)
+		color_stdout_is_tty = git_config_bool("command line", argv[1]);
+	return get_colorbool(argv[0], argc == 2);
+}
+
 static struct option builtin_config_options[] = {
 	OPT_GROUP(N_("Config file location")),
 	OPT_BOOL(0, "global", &use_global_config, N_("use global config file")),
@@ -671,12 +891,6 @@ static NORETURN void usage_builtin_config(void)
 
 int cmd_config(int argc, const char **argv, const char *prefix)
 {
-	int nongit = !startup_info->have_repository;
-	char *value = NULL;
-	int flags = 0;
-	int ret = 0;
-	struct key_value_info default_kvi = KVI_INIT;
-
 	given_config_source.file = xstrdup_or_null(getenv(CONFIG_ENVIRONMENT));
 
 	argc = parse_options(argc, argv, prefix, builtin_config_options,
@@ -690,7 +904,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		usage_builtin_config();
 	}
 
-	if (nongit) {
+	if (!startup_info->have_repository) {
 		if (use_local_config)
 			die(_("--local can only be used inside a git repository"));
 		if (given_config_source.blob)
@@ -751,7 +965,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		config_options.respect_includes = !given_config_source.file;
 	else
 		config_options.respect_includes = respect_includes_opt;
-	if (!nongit) {
+	if (startup_info->have_repository) {
 		config_options.commondir = get_git_common_dir();
 		config_options.git_dir = get_git_dir();
 	}
@@ -826,159 +1040,45 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 			usage_builtin_config();
 		}
 
-		flags |= CONFIG_FLAGS_FIXED_VALUE;
+		config_flags |= CONFIG_FLAGS_FIXED_VALUE;
 	}
 
 	if (actions & PAGING_ACTIONS)
 		setup_auto_pager("config", 1);
 
 	if (actions == ACTION_LIST) {
-		check_argc(argc, 0, 0);
-		if (config_with_options(show_all_config, NULL,
-					&given_config_source, the_repository,
-					&config_options) < 0) {
-			if (given_config_source.file)
-				die_errno(_("unable to read config file '%s'"),
-					  given_config_source.file);
-			else
-				die(_("error processing config file(s)"));
-		}
+		return cmd_config_list(argc, argv, prefix);
+	} else if (actions == ACTION_EDIT) {
+		return cmd_config_edit(argc, argv, prefix);
+	} else if (actions == ACTION_SET) {
+		return cmd_config_set(argc, argv, prefix);
+	} else if (actions == ACTION_SET_ALL) {
+		return cmd_config_set_all(argc, argv, prefix);
+	} else if (actions == ACTION_ADD) {
+		return cmd_config_add(argc, argv, prefix);
+	} else if (actions == ACTION_REPLACE_ALL) {
+		return cmd_config_replace_all(argc, argv, prefix);
+	} else if (actions == ACTION_GET) {
+		return cmd_config_get(argc, argv, prefix);
+	} else if (actions == ACTION_GET_ALL) {
+		return cmd_config_get_all(argc, argv, prefix);
+	} else if (actions == ACTION_GET_REGEXP) {
+		return cmd_config_get_regexp(argc, argv, prefix);
+	} else if (actions == ACTION_GET_URLMATCH) {
+		return cmd_config_get_urlmatch(argc, argv, prefix);
+	} else if (actions == ACTION_UNSET) {
+		return cmd_config_unset(argc, argv, prefix);
+	} else if (actions == ACTION_UNSET_ALL) {
+		return cmd_config_unset_all(argc, argv, prefix);
+	} else if (actions == ACTION_RENAME_SECTION) {
+		return cmd_config_rename_section(argc, argv, prefix);
+	} else if (actions == ACTION_REMOVE_SECTION) {
+		return cmd_config_remove_section(argc, argv, prefix);
+	} else if (actions == ACTION_GET_COLOR) {
+		return cmd_config_get_color(argc, argv, prefix);
+	} else if (actions == ACTION_GET_COLORBOOL) {
+		return cmd_config_get_colorbool(argc, argv, prefix);
 	}
-	else if (actions == ACTION_EDIT) {
-		char *config_file;
 
-		check_argc(argc, 0, 0);
-		if (!given_config_source.file && nongit)
-			die(_("not in a git directory"));
-		if (given_config_source.use_stdin)
-			die(_("editing stdin is not supported"));
-		if (given_config_source.blob)
-			die(_("editing blobs is not supported"));
-		git_config(git_default_config, NULL);
-		config_file = given_config_source.file ?
-				xstrdup(given_config_source.file) :
-				git_pathdup("config");
-		if (use_global_config) {
-			int fd = open(config_file, O_CREAT | O_EXCL | O_WRONLY, 0666);
-			if (fd >= 0) {
-				char *content = default_user_config();
-				write_str_in_full(fd, content);
-				free(content);
-				close(fd);
-			}
-			else if (errno != EEXIST)
-				die_errno(_("cannot create configuration file %s"), config_file);
-		}
-		launch_editor(config_file, NULL, NULL);
-		free(config_file);
-	}
-	else if (actions == ACTION_SET) {
-		check_write();
-		check_argc(argc, 2, 2);
-		value = normalize_value(argv[0], argv[1], &default_kvi);
-		ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
-		if (ret == CONFIG_NOTHING_SET)
-			error(_("cannot overwrite multiple values with a single value\n"
-			"       Use a regexp, --add or --replace-all to change %s."), argv[0]);
-	}
-	else if (actions == ACTION_SET_ALL) {
-		check_write();
-		check_argc(argc, 2, 3);
-		value = normalize_value(argv[0], argv[1], &default_kvi);
-		ret = git_config_set_multivar_in_file_gently(given_config_source.file,
-							     argv[0], value, argv[2],
-							     flags);
-	}
-	else if (actions == ACTION_ADD) {
-		check_write();
-		check_argc(argc, 2, 2);
-		value = normalize_value(argv[0], argv[1], &default_kvi);
-		ret = git_config_set_multivar_in_file_gently(given_config_source.file,
-							     argv[0], value,
-							     CONFIG_REGEX_NONE,
-							     flags);
-	}
-	else if (actions == ACTION_REPLACE_ALL) {
-		check_write();
-		check_argc(argc, 2, 3);
-		value = normalize_value(argv[0], argv[1], &default_kvi);
-		ret = git_config_set_multivar_in_file_gently(given_config_source.file,
-							     argv[0], value, argv[2],
-							     flags | CONFIG_FLAGS_MULTI_REPLACE);
-	}
-	else if (actions == ACTION_GET) {
-		check_argc(argc, 1, 2);
-		return get_value(argv[0], argv[1], flags);
-	}
-	else if (actions == ACTION_GET_ALL) {
-		do_all = 1;
-		check_argc(argc, 1, 2);
-		return get_value(argv[0], argv[1], flags);
-	}
-	else if (actions == ACTION_GET_REGEXP) {
-		show_keys = 1;
-		use_key_regexp = 1;
-		do_all = 1;
-		check_argc(argc, 1, 2);
-		return get_value(argv[0], argv[1], flags);
-	}
-	else if (actions == ACTION_GET_URLMATCH) {
-		check_argc(argc, 2, 2);
-		return get_urlmatch(argv[0], argv[1]);
-	}
-	else if (actions == ACTION_UNSET) {
-		check_write();
-		check_argc(argc, 1, 2);
-		if (argc == 2)
-			return git_config_set_multivar_in_file_gently(given_config_source.file,
-								      argv[0], NULL, argv[1],
-								      flags);
-		else
-			return git_config_set_in_file_gently(given_config_source.file,
-							     argv[0], NULL);
-	}
-	else if (actions == ACTION_UNSET_ALL) {
-		check_write();
-		check_argc(argc, 1, 2);
-		return git_config_set_multivar_in_file_gently(given_config_source.file,
-							      argv[0], NULL, argv[1],
-							      flags | CONFIG_FLAGS_MULTI_REPLACE);
-	}
-	else if (actions == ACTION_RENAME_SECTION) {
-		check_write();
-		check_argc(argc, 2, 2);
-		ret = git_config_rename_section_in_file(given_config_source.file,
-							argv[0], argv[1]);
-		if (ret < 0)
-			return ret;
-		else if (!ret)
-			die(_("no such section: %s"), argv[0]);
-		else
-			ret = 0;
-	}
-	else if (actions == ACTION_REMOVE_SECTION) {
-		check_write();
-		check_argc(argc, 1, 1);
-		ret = git_config_rename_section_in_file(given_config_source.file,
-							argv[0], NULL);
-		if (ret < 0)
-			return ret;
-		else if (!ret)
-			die(_("no such section: %s"), argv[0]);
-		else
-			ret = 0;
-	}
-	else if (actions == ACTION_GET_COLOR) {
-		check_argc(argc, 1, 2);
-		get_color(argv[0], argv[1]);
-	}
-	else if (actions == ACTION_GET_COLORBOOL) {
-		check_argc(argc, 1, 2);
-		if (argc == 2)
-			color_stdout_is_tty = git_config_bool("command line", argv[1]);
-		return get_colorbool(argv[0], argc == 2);
-	}
-
-	free(value);
-	return ret;
+	BUG("invalid action");
 }
-- 
2.44.0
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 116 in “builtin/config: introduce subcommands”
  1. 0/8 builtin/config: introduce subcommandsPatrick Steinhardt, Mar 6, 2024
  2. 1/8 builtin/config: move option array aroundPatrick Steinhardt, Mar 6, 2024
  3. 2/8 builtin/config: move "fixed-value" option to correct groupPatrick Steinhardt, Mar 6, 2024
  4. 3/8 builtin/config: use `OPT_CMDMODE()` to specify modesPatrick Steinhardt, Mar 6, 2024
  5. Taylor BlauMar 6, 2024
  6. Patrick SteinhardtMar 7, 2024
  7. 4/8 builtin/config: move modes into separate functionsPatrick Steinhardt, Mar 6, 2024
  8. 5/8 builtin/config: track subcommands by actionPatrick Steinhardt, Mar 6, 2024
  9. Jean-Noël AVILAMar 6, 2024
  10. Patrick SteinhardtMar 7, 2024
  11. Taylor BlauMar 7, 2024
  12. Patrick SteinhardtMar 7, 2024
  13. 6/8 builtin/config: introduce subcommandsPatrick Steinhardt, Mar 6, 2024
  14. Karthik NayakMar 6, 2024
  15. Patrick SteinhardtMar 7, 2024
  16. 7/8 t1300: exercise both old- and new-style modesPatrick Steinhardt, Mar 6, 2024
  17. 8/8 Documentation/git-config: update to new-style syntaxPatrick Steinhardt, Mar 6, 2024
  18. Eric SunshineMar 7, 2024
  19. Patrick SteinhardtMar 7, 2024
  20. Junio C HamanoMar 6, 2024
  21. Taylor BlauMar 6, 2024
  22. Junio C HamanoMar 6, 2024
  23. Taylor BlauMar 7, 2024
  24. Dragan SimicMar 7, 2024
  25. Patrick SteinhardtMar 7, 2024
  26. Junio C HamanoMar 7, 2024
  27. Kristoffer HaugsbakkMar 6, 2024
  28. 00/13 builtin/config: introduce subcommandsPatrick Steinhardt, Mar 11, 2024
  29. 01/13 builtin/config: move option array aroundPatrick Steinhardt, Mar 11, 2024
  30. 02/13 builtin/config: move "fixed-value" option to correct groupPatrick Steinhardt, Mar 11, 2024
  31. 03/13 builtin/config: use `OPT_CMDMODE()` to specify modesPatrick Steinhardt, Mar 11, 2024
  32. 04/13 builtin/config: pull out function to handle config locationPatrick Steinhardt, Mar 11, 2024
  33. 05/13 builtin/config: pull out function to handle `--null`Patrick Steinhardt, Mar 11, 2024
  34. 06/13 builtin/config: introduce "list" subcommandPatrick Steinhardt, Mar 11, 2024
  35. Eric SunshineMar 13, 2024
  36. Patrick SteinhardtMar 27, 2024
  37. 07/13 builtin/config: introduce "get" subcommandPatrick Steinhardt, Mar 11, 2024
  38. Eric SunshineMar 13, 2024
  39. Patrick SteinhardtMar 27, 2024
  40. 08/13 builtin/config: introduce "set" subcommandPatrick Steinhardt, Mar 11, 2024
  41. 09/13 builtin/config: introduce "unset" subcommandPatrick Steinhardt, Mar 11, 2024
  42. 10/13 builtin/config: introduce "rename-section" subcommandPatrick Steinhardt, Mar 11, 2024
  43. 11/13 builtin/config: introduce "remove-section" subcommandPatrick Steinhardt, Mar 11, 2024
  44. 12/13 builtin/config: introduce "edit" subcommandPatrick Steinhardt, Mar 11, 2024
  45. 13/13 builtin/config: display subcommand helpPatrick Steinhardt, Mar 11, 2024
  46. 00/13 builtin/config: introduce subcommandsPatrick Steinhardt, Mar 27, 2024
  47. 01/13 builtin/config: move option array aroundPatrick Steinhardt, Mar 27, 2024
  48. 02/13 builtin/config: move "fixed-value" option to correct groupPatrick Steinhardt, Mar 27, 2024
  49. 03/13 builtin/config: use `OPT_CMDMODE()` to specify modesPatrick Steinhardt, Mar 27, 2024
  50. 04/13 builtin/config: pull out function to handle config locationPatrick Steinhardt, Mar 27, 2024
  51. 05/13 builtin/config: pull out function to handle `--null`Patrick Steinhardt, Mar 27, 2024
  52. 06/13 builtin/config: introduce "list" subcommandPatrick Steinhardt, Mar 27, 2024
  53. 07/13 builtin/config: introduce "get" subcommandPatrick Steinhardt, Mar 27, 2024
  54. 08/13 builtin/config: introduce "set" subcommandPatrick Steinhardt, Mar 27, 2024
  55. 09/13 builtin/config: introduce "unset" subcommandPatrick Steinhardt, Mar 27, 2024
  56. 10/13 builtin/config: introduce "rename-section" subcommandPatrick Steinhardt, Mar 27, 2024
  57. 11/13 builtin/config: introduce "remove-section" subcommandPatrick Steinhardt, Mar 27, 2024
  58. 12/13 builtin/config: introduce "edit" subcommandPatrick Steinhardt, Mar 27, 2024
  59. 13/13 builtin/config: display subcommand helpPatrick Steinhardt, Mar 27, 2024
  60. Eric SunshineMar 27, 2024
  61. Patrick SteinhardtMar 27, 2024
  62. 00/14 builtin/config: introduce subcommandsPatrick Steinhardt, May 3, 2024
  63. 01/14 config: clarify memory ownership when preparing comment stringsPatrick Steinhardt, May 3, 2024
  64. Kristoffer HaugsbakkMay 3, 2024
  65. 02/14 builtin/config: move option array aroundPatrick Steinhardt, May 3, 2024
  66. 03/14 builtin/config: move "fixed-value" option to correct groupPatrick Steinhardt, May 3, 2024
  67. Karthik NayakMay 3, 2024
  68. Patrick SteinhardtMay 6, 2024
  69. 04/14 builtin/config: use `OPT_CMDMODE()` to specify modesPatrick Steinhardt, May 3, 2024
  70. 05/14 builtin/config: pull out function to handle config locationPatrick Steinhardt, May 3, 2024
  71. 06/14 builtin/config: pull out function to handle `--null`Patrick Steinhardt, May 3, 2024
  72. 07/14 builtin/config: introduce "list" subcommandPatrick Steinhardt, May 3, 2024
  73. Karthik NayakMay 3, 2024
  74. rsbecker@nexbridge.comMay 3, 2024
  75. Junio C HamanoMay 3, 2024
  76. Patrick SteinhardtMay 6, 2024
  77. Junio C HamanoMay 6, 2024
  78. rsbecker@nexbridge.comMay 6, 2024
  79. Dragan SimicMay 6, 2024
  80. Kristoffer HaugsbakkMay 7, 2024
  81. Git 3.0?Junio C Hamano, May 6, 2024
  82. Patrick SteinhardtMay 7, 2024
  83. Patrick SteinhardtMay 7, 2024
  84. Patrick SteinhardtMay 6, 2024
  85. Karthik NayakMay 6, 2024
  86. 08/14 builtin/config: introduce "get" subcommandPatrick Steinhardt, May 3, 2024
  87. 09/14 builtin/config: introduce "set" subcommandPatrick Steinhardt, May 3, 2024
  88. 10/14 builtin/config: introduce "unset" subcommandPatrick Steinhardt, May 3, 2024
  89. 11/14 builtin/config: introduce "rename-section" subcommandPatrick Steinhardt, May 3, 2024
  90. 12/14 builtin/config: introduce "remove-section" subcommandPatrick Steinhardt, May 3, 2024
  91. 13/14 builtin/config: introduce "edit" subcommandPatrick Steinhardt, May 3, 2024
  92. 14/14 builtin/config: display subcommand helpPatrick Steinhardt, May 3, 2024
  93. Dragan SimicMay 3, 2024
  94. Junio C HamanoMay 3, 2024
  95. 00/14 builtin/config: introduce subcommandsPatrick Steinhardt, May 6, 2024
  96. 01/14 config: clarify memory ownership when preparing comment stringsPatrick Steinhardt, May 6, 2024
  97. 02/14 builtin/config: move option array aroundPatrick Steinhardt, May 6, 2024
  98. 03/14 builtin/config: move "fixed-value" option to correct groupPatrick Steinhardt, May 6, 2024
  99. 04/14 builtin/config: use `OPT_CMDMODE()` to specify modesPatrick Steinhardt, May 6, 2024
  100. 05/14 builtin/config: pull out function to handle config locationPatrick Steinhardt, May 6, 2024
  101. 06/14 builtin/config: pull out function to handle `--null`Patrick Steinhardt, May 6, 2024
  102. 07/14 builtin/config: introduce "list" subcommandPatrick Steinhardt, May 6, 2024
  103. 08/14 builtin/config: introduce "get" subcommandPatrick Steinhardt, May 6, 2024
  104. SZEDER GáborAug 3, 2025
  105. Junio C HamanoAug 3, 2025
  106. Patrick SteinhardtSep 11, 2025
  107. 09/14 builtin/config: introduce "set" subcommandPatrick Steinhardt, May 6, 2024
  108. 10/14 builtin/config: introduce "unset" subcommandPatrick Steinhardt, May 6, 2024
  109. 11/14 builtin/config: introduce "rename-section" subcommandPatrick Steinhardt, May 6, 2024
  110. 12/14 builtin/config: introduce "remove-section" subcommandPatrick Steinhardt, May 6, 2024
  111. 13/14 builtin/config: introduce "edit" subcommandPatrick Steinhardt, May 6, 2024
  112. 14/14 builtin/config: display subcommand helpPatrick Steinhardt, May 6, 2024
  113. Karthik NayakMay 6, 2024
  114. Taylor BlauMay 6, 2024
  115. rsbecker@nexbridge.comMay 6, 2024
  116. Patrick SteinhardtMay 7, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.