add packet tracing debug code
This shows a trace of all packets coming in or out of a given program. This can help with debugging object negotiation or other protocol issues. To keep the code changes simple, we operate at the lowest level, meaning we don't necessarily understand what's in the packets. The one exception is a packet starting with "PACK", which causes us to skip that packet and turn off tracing (since the gigantic pack data will not be interesting to read, at least not in the trace format). We show both written and read packets. In the local case, this may mean you will see packets twice (written by the sender and read by the receiver). However, for cases where the other end is remote, this allows you to see the full conversation. Packet tracing can be enabled with GIT_TRACE_PACKET=<foo>, where <foo> takes the same arguments as GIT_TRACE. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
94b3b37464
commit
bbc30f9963
2
cache.h
2
cache.h
@ -1074,6 +1074,8 @@ extern void trace_repo_setup(const char *prefix);
|
||||
extern int trace_want(const char *key);
|
||||
extern void trace_strbuf(const char *key, const struct strbuf *buf);
|
||||
|
||||
void packet_trace_identity(const char *prog);
|
||||
|
||||
/* convert.c */
|
||||
/* returns 1 if *dst was used */
|
||||
extern int convert_to_git(const char *path, const char *src, size_t len,
|
||||
|
Reference in New Issue
Block a user