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

[PATCH 1/1] commit-graph: emit trace2 cmd_mode for each sub-command

From
GGGarima Singh via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 27, 2019, 16:56 UTC
Message-ID
<80496fdcfc42cd7ea883ea1a7200ab3611cbbca5.1566924992.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.323.git.gitgitgadget@gmail.com>
From: Garima Singh <garima.singh@microsoft.com>

Emit trace2_cmd_mode() messages for each commit-graph sub-command.

The commit graph commands were in flux when trace2 was making it's way to git. Now that we have enough sub-commands in commit-graph, we can label the various modes within them. Distinguishing between read, write and verify is a great start.

Signed-off-by: Garima Singh <garima.singh@microsoft.com>
---
 builtin/commit-graph.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 57863619b7..ef68b26744 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -58,6 +58,8 @@ static int graph_verify(int argc, const char **argv)
 		OPT_END(),
 	};
 
+	trace2_cmd_mode("verify");
+
 	argc = parse_options(argc, argv, NULL,
 			     builtin_commit_graph_verify_options,
 			     builtin_commit_graph_verify_usage, 0);
@@ -102,6 +104,8 @@ static int graph_read(int argc, const char **argv)
 		OPT_END(),
 	};
 
+	trace2_cmd_mode("read");
+
 	argc = parse_options(argc, argv, NULL,
 			     builtin_commit_graph_read_options,
 			     builtin_commit_graph_read_usage, 0);
@@ -183,6 +187,8 @@ static int graph_write(int argc, const char **argv)
 	split_opts.max_commits = 0;
 	split_opts.expire_time = 0;
 
+	trace2_cmd_mode("write");
+
 	argc = parse_options(argc, argv, NULL,
 			     builtin_commit_graph_write_options,
 			     builtin_commit_graph_write_usage, 0);
-- 
gitgitgadget
Previous: Garima Singh via GitGitGadgetNext: Garima Singh
Message 2 of 5 in “commit-graph: emit trace2 cmd_mode for each sub-command”
  1. 0/1 commit-graph: emit trace2 cmd_mode for each sub-commandGarima Singh via GitGitGadget, Aug 27, 2019
  2. 1/1 commit-graph: emit trace2 cmd_mode for each sub-commandGarima Singh via GitGitGadget, Aug 27, 2019
  3. Garima SinghSep 10, 2019
  4. Jeff HostetlerSep 11, 2019
  5. Johannes SchindelinOct 2, 2019

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.