{"thread":{"id":"58939","subject":"[PATCH] http-fetch: invoke trace2_cmd_name()","startedAt":"2022-12-12T22:46:53Z","lastAt":"2022-12-13T20:16:36Z","messageCount":2,"participants":["Jonathan Tan","Jeff Hostetler"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"468958","messageId":"20221212224630.2553391-1-jonathantanmy@google.com","threadId":"58939","inReplyTo":null,"subject":"[PATCH] http-fetch: invoke trace2_cmd_name()","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2022-12-12T22:46:30Z","receivedAt":"2022-12-12T22:46:53Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"ee4512ed48 (\"trace2: create new combined trace facility\", 2019-02-\n22) introduced trace2_cmd_name() and taught both the Git built-ins and\nsome non-built-ins to use it. However, http-fetch was not one of them\n(perhaps due to its low usage at the time).\n\nTeach http-fetch to invoke this function. After this patch, this\nfunction will be invoked right after argument parsing, just like in\nremote-curl.c.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\n---\nThis was discovered at $DAYJOB after we noticed that there were command\nnames missing in the trace whenever a user did a fetch that involved\npackfile offloading.\n---\n http-fetch.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/http-fetch.c b/http-fetch.c\nindex 31bc5c7767..258fec2068 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -5,6 +5,7 @@\n #include \"walker.h\"\n #include \"strvec.h\"\n #include \"urlmatch.h\"\n+#include \"trace2.h\"\n \n static const char http_fetch_usage[] = \"git http-fetch \"\n \"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url\";\n@@ -137,6 +138,8 @@ int cmd_main(int argc, const char **argv)\n \tif (nongit)\n \t\tdie(_(\"not a git repository\"));\n \n+\ttrace2_cmd_name(\"http-fetch\");\n+\n \tgit_config(git_default_config, NULL);\n \n \tif (packfile) {\n-- \n2.39.0.rc1.256.g54fd8350bd-goog\n\n"},{"id":"468997","messageId":"b9dc32bb-628c-4056-4c16-21bd51ad94fc@jeffhostetler.com","threadId":"58939","inReplyTo":"20221212224630.2553391-1-jonathantanmy@google.com","subject":"Re: [PATCH] http-fetch: invoke trace2_cmd_name()","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2022-12-13T20:15:23Z","receivedAt":"2022-12-13T20:16:36Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 12/12/22 5:46 PM, Jonathan Tan wrote:\n> ee4512ed48 (\"trace2: create new combined trace facility\", 2019-02-\n> 22) introduced trace2_cmd_name() and taught both the Git built-ins and\n> some non-built-ins to use it. However, http-fetch was not one of them\n> (perhaps due to its low usage at the time).\n> \n> Teach http-fetch to invoke this function. After this patch, this\n> function will be invoked right after argument parsing, just like in\n> remote-curl.c.\n> \n> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>\n> ---\n> This was discovered at $DAYJOB after we noticed that there were command\n> names missing in the trace whenever a user did a fetch that involved\n> packfile offloading.\n> ---\n>   http-fetch.c | 3 +++\n>   1 file changed, 3 insertions(+)\n> \n> diff --git a/http-fetch.c b/http-fetch.c\n> index 31bc5c7767..258fec2068 100644\n> --- a/http-fetch.c\n> +++ b/http-fetch.c\n> @@ -5,6 +5,7 @@\n>   #include \"walker.h\"\n>   #include \"strvec.h\"\n>   #include \"urlmatch.h\"\n> +#include \"trace2.h\"\n>   \n>   static const char http_fetch_usage[] = \"git http-fetch \"\n>   \"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url\";\n> @@ -137,6 +138,8 @@ int cmd_main(int argc, const char **argv)\n>   \tif (nongit)\n>   \t\tdie(_(\"not a git repository\"));\n>   \n> +\ttrace2_cmd_name(\"http-fetch\");\n> +\n>   \tgit_config(git_default_config, NULL);\n>   \n>   \tif (packfile) {\n\nLGTM\n\nThanks for catching this.\nJeff\n"}]}