Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Mar 22, 2011

  1. Stephen Boyd

    Fix sparse warnings

    Fix warnings from 'make check'.
    
     - These files don't include 'builtin.h' causing sparse to complain that
       cmd_* isn't declared:
    
       builtin/clone.c:364, builtin/fetch-pack.c:797,
       builtin/fmt-merge-msg.c:34, builtin/hash-object.c:78,
       builtin/merge-index.c:69, builtin/merge-recursive.c:22
       builtin/merge-tree.c:341, builtin/mktag.c:156, builtin/notes.c:426
       builtin/notes.c:822, builtin/pack-redundant.c:596,
       builtin/pack-refs.c:10, builtin/patch-id.c:60, builtin/patch-id.c:149,
       builtin/remote.c:1512, builtin/remote-ext.c:240,
       builtin/remote-fd.c:53, builtin/reset.c:236, builtin/send-pack.c:384,
       builtin/unpack-file.c:25, builtin/var.c:75
    
     - These files have symbols which should be marked static since they're
       only file scope:
    
       submodule.c:12, diff.c:631, replace_object.c:92, submodule.c:13,
       submodule.c:14, trace.c:78, transport.c:195, transport-helper.c:79,
       unpack-trees.c:19, url.c:3, url.c:18, url.c:104, url.c:117, url.c:123,
       url.c:129, url.c:136, thread-utils.c:21, thread-utils.c:48
    
     - These files redeclare symbols to be different types:
    
       builtin/index-pack.c:210, parse-options.c:564, parse-options.c:571,
       usage.c:49, usage.c:58, usage.c:63, usage.c:72
    
     - These files use a literal integer 0 when they really should use a NULL
       pointer:
    
       daemon.c:663, fast-import.c:2942, imap-send.c:1072, notes-merge.c:362
    
    While we're in the area, clean up some unused #includes in builtin files
    (mostly exec_cmd.h).
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bebarino authored gitster committed

Mar 08, 2011

  1. Jeff King

    trace: give repo_setup trace its own key

    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>
    peff authored gitster committed
  2. Jeff King

    trace: add trace_strbuf

    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>
    peff authored gitster committed
  3. Jeff King

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

    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>
    peff authored gitster committed
  4. Jeff King

    trace: refactor to support multiple env variables

    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>
    peff authored gitster committed
  5. Jeff King

    trace: add trace_vprintf

    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>
    peff authored gitster committed

Feb 26, 2011

  1. Jeff King

    strbuf: add strbuf_vaddf

    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>
    peff authored gitster committed

Jan 06, 2011

  1. Brandon Casey

    trace.c: ensure NULL is not passed to printf

    GNU printf, and many others, will print the string "(null)" if a NULL
    pointer is passed as the argument to a "%s" format specifier.  Some
    implementations (like on Solaris) do not detect a NULL pointer and will
    produce a segfault in this case.
    
    So, fix this by ensuring that pointer variables do not contain the value
    NULL.  Assign the string "(null)" to the variables are NULL.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    drafnel authored gitster committed

Dec 28, 2010

  1. Junio C Hamano

    Merge branch 'nd/setup'

    * nd/setup: (47 commits)
      setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwd
      git.txt: correct where --work-tree path is relative to
      Revert "Documentation: always respect core.worktree if set"
      t0001: test git init when run via an alias
      Remove all logic from get_git_work_tree()
      setup: rework setup_explicit_git_dir()
      setup: clean up setup_discovered_git_dir()
      t1020-subdirectory: test alias expansion in a subdirectory
      setup: clean up setup_bare_git_dir()
      setup: limit get_git_work_tree()'s to explicit setup case only
      Use git_config_early() instead of git_config() during repo setup
      Add git_config_early()
      git-rev-parse.txt: clarify --git-dir
      t1510: setup case #31
      t1510: setup case #30
      t1510: setup case #29
      t1510: setup case #28
      t1510: setup case #27
      t1510: setup case #26
      t1510: setup case #25
      ...
    gitster authored

Dec 21, 2010

  1. Junio C Hamano

    set_try_to_free_routine(NULL) means "do nothing special"

    This way, the next caller that wants to disable our memory reclamation
    machinery does not have to define its own do_nothing() stub.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

Dec 17, 2010

  1. vvavrychuk

    trace.c: mark file-local function static

    Signed-off-by: Vasyl' Vavrychuk <vvavrychuk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    vvavrychuk authored gitster committed

Nov 29, 2010

  1. Nguyễn Thái Ngọc Duy

    builtins: print setup info if repo is found

    Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    pclouds authored gitster committed

May 09, 2010

  1. Do not call release_pack_memory in malloc wrappers when GIT_TRACE is …

    …used
    
    This avoids a potential race condition when async procedures are
    implemented as threads where release_pack_memory() can be called from
    different threads without locking under memory pressure.
    
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Johannes Sixt authored gitster committed

Feb 25, 2009

  1. Allan Caffee

    trace: Fixed a minor typo in an error message.

    Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    allancaffee authored gitster committed

Dec 04, 2007

  1. Christian Couder

    Trace and quote with argv: get rid of unneeded count argument.

    Now that str_buf takes care of all the allocations, there is
    no more gain to pass an argument count.
    
    So this patch removes the "count" argument from:
    	- "sq_quote_argv"
    	- "trace_argv_printf"
    and all the callers.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    chriscool authored gitster committed

Nov 26, 2007

  1. sprohaska

    Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c

    Using the helper function to test for absolute paths makes porting easier.
    
    Signed-off-by: Steffen Prohaska <prohaska@zib.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sprohaska authored gitster committed

Nov 14, 2007

  1. Shawn O. Pearce

    Handle broken vsnprintf implementations in strbuf

    Solaris 9's vsnprintf implementation returns -1 if we pass it a
    buffer of length 0.  The only way to get it to give us the actual
    length necessary for the formatted string is to grow the buffer
    out to have at least 1 byte available in the strbuf and then ask
    it to compute the length.
    
    If the available space is 0 I'm growing it out by 64 to ensure
    we will get an accurate length estimate from all implementations.
    Some callers may need to grow the strbuf again but 64 should be a
    reasonable enough initial growth.
    
    We also no longer silently fail to append to the string when we are
    faced with a broken vsnprintf implementation.  On Solaris 9 this
    silent failure caused me to no longer be able to execute "git clone"
    as we tried to exec the empty string rather than "git-clone".
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    spearce authored gitster committed

Sep 21, 2007

  1. Pierre Habouzit

    sq_quote_argv and add_to_string rework with strbuf's.

    * sq_quote_buf is made public, and works on a strbuf.
    * sq_quote_argv also works on a strbuf.
    * make sq_quote_argv take a "maxlen" argument to check the buffer won't grow
      too big.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    MadCoder authored gitster committed
  2. Pierre Habouzit

    nfv?asprintf are broken without va_copy, workaround them.

    * drop nfasprintf.
    * move nfvasprintf into imap-send.c back, and let it work on a 8k buffer,
      and die() in case of overflow. It should be enough for imap commands, if
      someone cares about imap-send, he's welcomed to fix it properly.
    * replace nfvasprintf use in merge-recursive with a copy of the strbuf_addf
      logic, it's one place, we'll live with it.
      To ease the change, output_buffer string list is replaced with a strbuf ;)
    * rework trace.c to call vsnprintf itself.  It's used to format strerror()s
      and git command names, it should never be more than a few octets long, let
      it work on a 8k static buffer with vsnprintf or die loudly.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    MadCoder authored gitster committed

Mar 11, 2007

  1. git-branch, git-checkout: autosetup for remote branch tracking

    In order to track and build on top of a branch 'topic' you track from
    your upstream repository, you often would end up doing this sequence:
    
      git checkout -b mytopic origin/topic
      git config --add branch.mytopic.remote origin
      git config --add branch.mytopic.merge refs/heads/topic
    
    This would first fork your own 'mytopic' branch from the 'topic'
    branch you track from the 'origin' repository; then it would set up two
    configuration variables so that 'git pull' without parameters does the
    right thing while you are on your own 'mytopic' branch.
    
    This commit adds a --track option to git-branch, so that "git
    branch --track mytopic origin/topic" performs the latter two actions
    when creating your 'mytopic' branch.
    
    If the configuration variable branch.autosetupmerge is set to true, you
    do not have to pass the --track option explicitly; further patches in
    this series allow setting the variable with a "git remote add" option.
    The configuration variable is off by default, and there is a --no-track
    option to countermand it even if the variable is set.
    
    Signed-off-by: Paolo Bonzini  <bonzini@gnu.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Paolo Bonzini authored Junio C Hamano committed

Jan 08, 2007

  1. Andy Whitcroft

    short i/o: clean up the naming for the write_{in,or}_xxx family

    We recently introduced a write_in_full() which would either write
    the specified object or emit an error message and fail.  In order
    to fix the read side we now want to introduce a read_in_full()
    but without an error emit.  This patch cleans up the naming
    of this family of calls:
    
    1) convert the existing write_or_whine() to write_or_whine_pipe()
       to better indicate its pipe specific nature,
    2) convert the existing write_in_full() calls to write_or_whine()
       to better indicate its nature,
    3) introduce a write_in_full() providing a write or fail semantic,
       and
    4) convert write_or_whine() and write_or_whine_pipe() to use
       write_in_full().
    
    Signed-off-by: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    awhitcroft authored Junio C Hamano committed

Oct 14, 2006

  1. Christian Couder

    Fix tracing when GIT_TRACE is set to an empty string.

    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    chriscool authored Junio C Hamano committed

Sep 13, 2006

  1. Christian Couder

    Fix space in string " false" problem in "trace.c".

    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    chriscool authored Junio C Hamano committed

Sep 02, 2006

  1. Christian Couder

    Trace into a file or an open fd and refactor tracing code.

    If GIT_TRACE is set to an absolute path (starting with a
    '/' character), we interpret this as a file path and we
    trace into it.
    
    Also if GIT_TRACE is set to an integer value greater than
    1 and lower than 10, we interpret this as an open fd value
    and we trace into it.
    
    Note that this behavior is not compatible with the
    previous one.
    
    We also trace whole messages using one write(2) call to
    make sure messages from processes do net get mixed up in
    the middle.
    
    This patch makes it possible to get trace information when
    running "make test".
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    chriscool authored Junio C Hamano committed
Something went wrong with that request. Please try again.