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

[PATCH 1/7] builtin/commit-graph: rename subcommand functions

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 28, 2026, 11:57 UTC
Message-ID
<20261028-pks-commit-graph-cleanups-v1-1-c549344c363f@pks.im>
In-Reply-To
<20261028-pks-commit-graph-cleanups-v1-0-c549344c363f@pks.im>

Subcommands that we wire up via `OPT_SUBCOMMAND()` are typically called `cmd_<command>_<subcommand>()`, but we don't follow that pattern in "builtin/commit-graph.c". Rename the functions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 builtin/commit-graph.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index ff244c866fe..415eb6afee9 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -65,8 +65,10 @@ static struct option *add_common_options(struct option *to)
 	return parse_options_concat(common_opts, to);
 }
 
-static int graph_verify(int argc, const char **argv, const char *prefix,
-			struct repository *repo UNUSED)
+static int cmd_commit_graph_verify(int argc,
+				   const char **argv,
+				   const char *prefix,
+				   struct repository *repo UNUSED)
 {
 	struct commit_graph *graph = NULL;
 	struct odb_files_dir *dir = NULL;
@@ -224,8 +226,10 @@ static int git_commit_graph_write_config(const char *var, const char *value,
 	return 0;
 }
 
-static int graph_write(int argc, const char **argv, const char *prefix,
-		       struct repository *repo UNUSED)
+static int cmd_commit_graph_write(int argc,
+				  const char **argv,
+				  const char *prefix,
+				  struct repository *repo UNUSED)
 {
 	struct string_list pack_indexes = STRING_LIST_INIT_DUP;
 	struct strbuf buf = STRBUF_INIT;
@@ -362,8 +366,8 @@ int cmd_commit_graph(int argc,
 {
 	parse_opt_subcommand_fn *fn = NULL;
 	struct option builtin_commit_graph_options[] = {
-		OPT_SUBCOMMAND("verify", &fn, graph_verify),
-		OPT_SUBCOMMAND("write", &fn, graph_write),
+		OPT_SUBCOMMAND("verify", &fn, cmd_commit_graph_verify),
+		OPT_SUBCOMMAND("write", &fn, cmd_commit_graph_write),
 		OPT_END(),
 	};
 	struct option *options = parse_options_concat(builtin_commit_graph_options, common_opts);
-- 
2.56.0.341.g393f52fd96.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 2 of 12 in “builtin/commit-graph: some small cleanups”
  1. 0/7 builtin/commit-graph: some small cleanupsPatrick Steinhardt, Oct 28, 2026
  2. 1/7 builtin/commit-graph: rename subcommand functionsPatrick Steinhardt, Oct 28, 2026
  3. 2/7 builtin/commit-graph: drop declaration for `read_replace_refs`Patrick Steinhardt, Oct 28, 2026
  4. 3/7 builtin/commit-graph: get rid of `the_repository`Patrick Steinhardt, Oct 28, 2026
  5. 4/7 builtin/commit-graph: drop global "--object-dir=" switchPatrick Steinhardt, Oct 28, 2026
  6. 5/7 builtin/commit-graph: simplify how we wire up common optionsPatrick Steinhardt, Oct 28, 2026
  7. 6/7 builtin/commit-graph: de-globalize write options handlingPatrick Steinhardt, Oct 28, 2026
  8. 7/7 builtin/commit-graph: de-globalize options handlingPatrick Steinhardt, Oct 28, 2026
  9. Mark C. Chu-CarrollOct 28, 2026
  10. Junio C HamanoOct 28, 2026
  11. Junio C HamanoOct 28, 2026
  12. Karthik NayakOct 29, 2026

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.