path: root/builtin/push.c
diff options
authorJeff King <>2011-02-24 14:30:19 (GMT)
committerJunio C Hamano <>2011-03-08 20:12:04 (GMT)
commitbbc30f996380eacd71ca061675d5d0c5f21c45d2 (patch)
treef4a2531496b943eb6339cffd71a251df3a83d6a7 /builtin/push.c
parent94b3b3746456949d834ec7bf454da3db4eb439cf (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/push.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/push.c b/builtin/push.c
index e655eb7..26171ff 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -228,6 +228,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
+ packet_trace_identity("push");
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, push_usage, 0);