* [PATCH] http-fetch: invoke trace2_cmd_name()
@ 2022-12-12 22:46 Jonathan Tan
2022-12-13 20:15 ` Jeff Hostetler
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Tan @ 2022-12-12 22:46 UTC (permalink / raw)
To: git; +Cc: Jonathan Tan
ee4512ed48 ("trace2: create new combined trace facility", 2019-02-
22) introduced trace2_cmd_name() and taught both the Git built-ins and
some non-built-ins to use it. However, http-fetch was not one of them
(perhaps due to its low usage at the time).
Teach http-fetch to invoke this function. After this patch, this
function will be invoked right after argument parsing, just like in
remote-curl.c.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
This was discovered at $DAYJOB after we noticed that there were command
names missing in the trace whenever a user did a fetch that involved
packfile offloading.
---
http-fetch.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/http-fetch.c b/http-fetch.c
index 31bc5c7767..258fec2068 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -5,6 +5,7 @@
#include "walker.h"
#include "strvec.h"
#include "urlmatch.h"
+#include "trace2.h"
static const char http_fetch_usage[] = "git http-fetch "
"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url";
@@ -137,6 +138,8 @@ int cmd_main(int argc, const char **argv)
if (nongit)
die(_("not a git repository"));
+ trace2_cmd_name("http-fetch");
+
git_config(git_default_config, NULL);
if (packfile) {
--
2.39.0.rc1.256.g54fd8350bd-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] http-fetch: invoke trace2_cmd_name()
2022-12-12 22:46 [PATCH] http-fetch: invoke trace2_cmd_name() Jonathan Tan
@ 2022-12-13 20:15 ` Jeff Hostetler
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Hostetler @ 2022-12-13 20:15 UTC (permalink / raw)
To: Jonathan Tan, git
On 12/12/22 5:46 PM, Jonathan Tan wrote:
> ee4512ed48 ("trace2: create new combined trace facility", 2019-02-
> 22) introduced trace2_cmd_name() and taught both the Git built-ins and
> some non-built-ins to use it. However, http-fetch was not one of them
> (perhaps due to its low usage at the time).
>
> Teach http-fetch to invoke this function. After this patch, this
> function will be invoked right after argument parsing, just like in
> remote-curl.c.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> This was discovered at $DAYJOB after we noticed that there were command
> names missing in the trace whenever a user did a fetch that involved
> packfile offloading.
> ---
> http-fetch.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/http-fetch.c b/http-fetch.c
> index 31bc5c7767..258fec2068 100644
> --- a/http-fetch.c
> +++ b/http-fetch.c
> @@ -5,6 +5,7 @@
> #include "walker.h"
> #include "strvec.h"
> #include "urlmatch.h"
> +#include "trace2.h"
>
> static const char http_fetch_usage[] = "git http-fetch "
> "[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin | --packfile=hash | commit-id] url";
> @@ -137,6 +138,8 @@ int cmd_main(int argc, const char **argv)
> if (nongit)
> die(_("not a git repository"));
>
> + trace2_cmd_name("http-fetch");
> +
> git_config(git_default_config, NULL);
>
> if (packfile) {
LGTM
Thanks for catching this.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-13 20:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 22:46 [PATCH] http-fetch: invoke trace2_cmd_name() Jonathan Tan
2022-12-13 20:15 ` Jeff Hostetler
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).