[PATCHv2 0/4] Implements the GIT_TRACE_CURL environment variable
This is the second version but in reality is the complete rewriting of the patches discussed here
Changes from V1
- introduced GIT_TRACE_CURL variable with its documentation
- changed the name of the temporary variable "i" in "w" in the helper routine
- used the c escape sequences instead of the hex equivalent
- dropped the previous GIT_DEBUG_CURL env var
- curl_dump and curl_trace factored out to a shared implementation
Elia Pinto (4):
http.h: Add debug callback and helper routine for implementing the
GIT_TRACE_CURL environment variable in http.c
http.c: implements the GIT_TRACE_CURL environment variable
git.txt: document the new GIT_TRACE_CURL environment variable
imap-send.c: introduce the GIT_TRACE_CURL enviroment variable
Implements the GIT_TRACE_CURL environment variable to allow a
greater degree of detail of GIT_CURL_VERBOSE, in particular
the complete transport header and all the data payload exchanged.
It might be useful if a particular situation could require a more
thorough debugging analysis
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 8afe349..958db0f 100644
@@ -1075,6 +1075,14 @@ of clones and fetches.
cloning of shallow repositories.
See 'GIT_TRACE' for available trace output options.
+ Enables a curl full trace dump of all incoming and outgoing data,
+ including descriptive information, of the git transport protocol.
+ This is similar to doing curl --trace-ascii on the command line.
+ This option overrides setting the GIT_CURL_VERBOSE environment
+ See 'GIT_TRACE' for available trace output options.
Setting this variable to `1` will cause Git to treat all
pathspecs literally, rather than as glob patterns. For example,
> Add the debug callback and helper routine prototype used by
> curl_easy_setopt CURLOPT_DEBUGFUNCTION in http.c
> for implementing the GIT_TRACE_CURL environment variable
> Helped-by: Torsten Bögershausen <[hidden email]>
> Helped-by: Ramsay Jones <[hidden email]>
> Helped-by: Junio C Hamano <[hidden email]>
> Helped-by: Eric Sunshine <[hidden email]>
> Helped-by: Jeff King <[hidden email]>
> Signed-off-by: Elia Pinto <[hidden email]>
> http.h | 6 ++++++
> 1 file changed, 6 insertions(+)
> diff --git a/http.h b/http.h
> index 4ef4bbd..a2d10bc 100644
> --- a/http.h
> +++ b/http.h
> @@ -224,4 +224,10 @@ extern int finish_http_object_request(struct http_object_request *freq);
> extern void abort_http_object_request(struct http_object_request *freq);
> extern void release_http_object_request(struct http_object_request *freq);
> +/* Debug callback and helper routine for curl_easy_setopt CURLOPT_DEBUGFUNCTION */
> +static struct trace_key trace_curl = TRACE_KEY_INIT(CURL);
Ah no, this would add 6 instances of the 'trace_curl' key in http-fetch.c,
http-push.c, http-walker.c, http.c, imap-send.c and remote-curl.c. Hmm ...
since these would end up in different executables (by and large) it might
work OK, ... but is simply not necessary.
Also, patches #1 and #2 should be squashed into one patch and, since the
curl_dump() function is only called from http.c, it can be a static symbol.
I think the minimal fixup (including Junio's comment on patch #2, which also
triggered for me) is given in the patch below.
Re: [PATCH 1/4] http.h: Add debug callback and helper routine for implementing the GIT_TRACE_CURL environment variable in http.c
On 19/04/16 22:48, Ramsay Jones wrote:
> I think the minimal fixup (including Junio's comment on patch #2, which also
> triggered for me) is given in the patch below.
BTW, if you want to have a single static instance of the 'struct trace_key',
then the following patch on top should work. (Also, I have compiled and run
the testsuite on these patches, but _not_ tested that the trace functionality
actually works!) ;-)
-- >8 --
Subject: [PATCH] curl-trace: reduce visibility of the trace key struct