• Jeff King's avatar
    pkt-line: support tracing verbatim pack contents · 32359838
    Jeff King authored
    When debugging the pack protocol, it is sometimes useful to
    store the verbatim pack that we sent or received on the
    wire. Looking at the on-disk result is often not helpful for
    a few reasons:
    
      1. If the operation is a clone, we destroy the repo on
         failure, leaving nothing on disk.
    
      2. If the pack is small, we unpack it immediately, and the
         full pack never hits the disk.
    
      3. If we feed the pack to "index-pack --fix-thin", the
         resulting pack has the extra delta bases added to it.
    
    We already have a GIT_TRACE_PACKET mechanism for tracing
    packets. Let's extend it with GIT_TRACE_PACKFILE to dump the
    verbatim packfile.
    
    There are a few other positive fallouts that come from
    rearranging this code:
    
     - We currently disable the packet trace after seeing the
       PACK header, even though we may get human-readable lines
       on other sidebands; now we include them in the trace.
    
     - We currently try to print "PACK ..." in the trace to
       indicate that the packfile has started. But because we
       disable packet tracing, we never printed this line. We
       will now do so.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    32359838
trace.h 3.62 KB