Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jun 16, 2015
  1. @peff @gitster

    pkt-line: support tracing verbatim pack contents

    peff authored gitster committed
    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: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 10, 2013
  1. @peff @gitster

    add missing "format" function attributes

    peff authored gitster committed
    For most of our functions that take printf-like formats, we
    use gcc's __attribute__((format)) to get compiler warnings
    when the functions are misused. Let's give a few more
    functions the same protection.
    
    In most cases, the annotations do not uncover any actual
    bugs; the only code change needed is that we passed a size_t
    to transfer_debug, which expected an int. Since we expect
    the passed-in value to be a relatively small buffer size
    (and cast a similar value to int directly below), we can
    just cast away the problem.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 8, 2011
  1. @peff @gitster

    trace: give repo_setup trace its own key

    peff authored gitster committed
    You no longer get this output with GIT_TRACE=1; instead, you
    can do GIT_TRACE_SETUP=1.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @peff @gitster

    trace: add trace_strbuf

    peff authored gitster committed
    If you happen to have a strbuf, it is a little more readable
    and a little more efficient to be able to print it directly
    instead of jamming it through the trace_printf interface.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @peff @gitster

    trace: factor out "do we want to trace" logic

    peff authored gitster committed
    As we add more tracing areas, this will avoid repeated code.
    
    Technically, trace_printf already checks this and will avoid
    printing if the trace key is not set. However, callers may
    want to find out early whether or not tracing is enabled so
    they can avoid doing work in the common non-trace case.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @peff @gitster

    trace: refactor to support multiple env variables

    peff authored gitster committed
    Right now you turn all tracing off and on with GIT_TRACE. To
    support new types of tracing without forcing the user to see
    all of them, we will soon support turning each tracing area
    on with GIT_TRACE_*.
    
    This patch lays the groundwork by providing an interface
    which does not assume GIT_TRACE. However, we still maintain
    the trace_printf interface so that existing callers do not
    need to be refactored.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  5. @peff @gitster

    trace: add trace_vprintf

    peff authored gitster committed
    This is a necessary cleanup to adding new types of trace
    functions.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 26, 2011
  1. @peff @gitster

    strbuf: add strbuf_vaddf

    peff authored gitster committed
    In a variable-args function, the code for writing into a strbuf is
    non-trivial. We ended up cutting and pasting it in several places
    because there was no vprintf-style function for strbufs (which in turn
    was held up by a lack of va_copy).
    
    Now that we have a fallback va_copy, we can add strbuf_vaddf, the
    strbuf equivalent of vsprintf. And we can clean up the cut and paste
    mess.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Improved-by: Christian Couder <christian.couder@gmail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.