Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on May 25, 2009
  1. @bebarino @gitster

    parse-opts: prepare for OPT_FILENAME

    bebarino authored gitster committed
    To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
    which passes the prefix to parse_options_start() which sets the prefix
    member of parse_opts_ctx accordingly. If there isn't a prefix in the
    calling context, passing NULL will suffice.
    Signed-off-by: Stephen Boyd <>
    Signed-off-by: Junio C Hamano <>
Commits on May 1, 2009
  1. @felipec @gitster

    Fix a bunch of pointer declarations (codestyle)

    felipec authored gitster committed
    Essentially; s/type* /type */ as per the coding guidelines.
    Signed-off-by: Felipe Contreras <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 19, 2008
  1. @gitster

    parse-opt: migrate builtin-checkout-index.

    Miklos Vajna authored gitster committed
    Signed-off-by: Miklos Vajna <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 12, 2008
  1. @spearce

    Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer

    Brandon Casey authored spearce committed
    Many call sites use strbuf_init(&foo, 0) to initialize local
    strbuf variable "foo" which has not been accessed since its
    declaration. These can be replaced with a static initialization
    using the STRBUF_INIT macro which is just as readable, saves a
    function call, and takes up fewer lines.
    Signed-off-by: Brandon Casey <>
    Signed-off-by: Shawn O. Pearce <>
Commits on Sep 9, 2008
  1. @heikkiorsila @gitster

    Start conforming code to "git subcmd" style part 2

    heikkiorsila authored gitster committed
    User notifications are presented as 'git cmd', and code comments
    are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'.
    Signed-off-by: Heikki Orsila <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 31, 2008
  1. @gitster

    'git foo' program identifies itself without dash in die() messages

    gitster authored
    This is a mechanical conversion of all '*.c' files with:
    	s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;
    The result was manually inspected and no false positive was found.
    Signed-off-by: Junio C Hamano <>
Commits on Jul 13, 2008
  1. @sbeyer @gitster

    Make usage strings dash-less

    sbeyer authored gitster committed
    When you misuse a git command, you are shown the usage string.
    But this is currently shown in the dashed form.  So if you just
    copy what you see, it will not work, when the dashed form
    is no longer supported.
    This patch makes git commands show the dash-less version.
    For shell scripts that do not specify OPTIONS_SPEC,
    generates a dash-less usage string now.
    Signed-off-by: Stephan Beyer <>
    Signed-off-by: Junio C Hamano <>
Commits on May 14, 2008
  1. @dscho @gitster

    Provide git_config with a callback-data parameter

    dscho authored gitster committed
    git_config() only had a function parameter, but no callback data
    parameter.  This assumes that all callback functions only modify
    global variables.
    With this patch, every callback gets a void * parameter, and it is hoped
    that this will help the libification effort.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Jan 16, 2008
  1. @gitster

    Improve use of lockfile API

    Brandon Casey authored gitster committed
    Remove remaining double close(2)'s.  i.e. close() before
    commit_locked_index() or commit_lock_file().
    Signed-off-by: Junio C Hamano <>
Commits on Sep 21, 2007
  1. @gitster

    Full rework of quote_c_style and write_name_quoted.

    Pierre Habouzit authored gitster committed
    * quote_c_style works on a strbuf instead of a wild buffer.
    * quote_c_style is now clever enough to not add double quotes if not needed.
    * write_name_quoted inherits those advantages, but also take a different
      set of arguments. Now instead of asking for quotes or not, you pass a
      "terminator". If it's \0 then we assume you don't want to escape, else C
      escaping is performed. In any case, the terminator is also appended to the
      stream. It also no longer takes the prefix/prefix_len arguments, as it's
      seldomly used, and makes some optimizations harder.
    * write_name_quotedpfx is created to work like write_name_quoted and take
      the prefix/prefix_len arguments.
    Thanks to those API changes, diff.c has somehow lost weight, thanks to the
    removal of functions that were wrappers around the old write_name_quoted
    trying to give it a semantics like the new one, but performing a lot of
    allocations for this goal. Now we always write directly to the stream, no
    intermediate allocation is performed.
    As a side effect of the refactor in builtin-apply.c, the length of the bar
    graphs in diffstats are not affected anymore by the fact that the path was
    Signed-off-by: Pierre Habouzit <>
  2. @gitster

    Rework unquote_c_style to work on a strbuf.

    Pierre Habouzit authored gitster committed
    If the gain is not obvious in the diffstat, the resulting code is more
    readable, _and_ in checkout-index/update-index we now reuse the same buffer
    to unquote strings instead of always freeing/mallocing.
    This also is more coherent with the next patch that reworks quoting
    The quoting function is also made more efficient scanning for backslashes
    and treating portions of strings without a backslash at once.
    Signed-off-by: Pierre Habouzit <>
Commits on Sep 18, 2007
  1. @gitster

    Drop strbuf's 'eof' marker, and make read_line a first class citizen.

    Pierre Habouzit authored gitster committed
    read_line is now strbuf_getline, and is a first class citizen, it returns 0
    when reading a line worked, EOF else.
    The ->eof marker was used non-locally by fast-import.c, mimic the same
    behaviour using a static int in "read_next_command", that now returns -1 on
    EOF, and avoids to call strbuf_getline when it's in EOF state.
    Also no longer automagically strbuf_release the buffer, it's counter
    intuitive and breaks fast-import in a very subtle way.
    Note: being at EOF implies that command_buf.len == 0.
    Signed-off-by: Pierre Habouzit <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 17, 2007
  1. @gitster

    Now that cache.h needs strbuf.h, remove useless includes.

    Pierre Habouzit authored gitster committed
    Signed-off-by: Pierre Habouzit <>
    Acked-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 10, 2007
  1. @gitster

    Strbuf API extensions and fixes.

    Pierre Habouzit authored gitster committed
      * Add strbuf_rtrim to remove trailing spaces.
      * Add strbuf_insert to insert data at a given position.
      * Off-by one fix in strbuf_addf: strbuf_avail() does not counts the final
        \0 so the overflow test for snprintf is the strict comparison. This is
        not critical as the growth mechanism chosen will always allocate _more_
        memory than asked, so the second test will not fail. It's some kind of
        miracle though.
      * Add size extension hints for strbuf_init and strbuf_read. If 0, default
        applies, else:
          + initial buffer has the given size for strbuf_init.
          + first growth checks it has at least this size rather than the
            default 8192.
    Signed-off-by: Pierre Habouzit <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 15, 2007
  1. @gitster

    Make every builtin-*.c file #include "builtin.h"

    Peter Hagervall authored gitster committed
    Make every builtin-*.c file #include "builtin.h".
    Also takes care of some declaration/definition mismatches.
    Signed-off-by: Peter Hagervall <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 4, 2007
  1. _GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index f…

    Junio C Hamano authored
    When defined, this allows plumbing commands that update the
    index (add, apply, checkout-index, merge-recursive, mv,
    read-tree, rm, update-index, and write-tree) to write their
    resulting index to an alternative index file while holding a
    lock to the original index file.  With this, git-commit that
    jumps the index does not have to make an extra copy of the index
    file, and more importantly, it can do the update while holding
    the lock on the index.
    However, I think the interface to let an environment variable
    specify the output is a mistake, as shown in the documentation.
    If a curious user has the environment variable set to something
    other than the file GIT_INDEX_FILE points at, almost everything
    will break.  This should instead be a command line parameter to
    tell these plumbing commands to write the result in the named
    file, to prevent stupid mistakes.
    Signed-off-by: Junio C Hamano <>
Commits on Feb 21, 2007
  1. Mechanical conversion to use prefixcmp()

    Junio C Hamano authored
    This mechanically converts strncmp() to use prefixcmp(), but only when
    the parameters match specific patterns, so that they can be verified
    easily.  Leftover from this will be fixed in a separate step, including
    idiotic conversions like
        if (!strncmp("foo", arg, 3))
        if (!(-prefixcmp(arg, "foo")))
    This was done by using this script in px.perl
       #!/usr/bin/perl -i.bak -p
       if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
               s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
       if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
               s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
    and running:
       $ git grep -l strncmp -- '*.c' | xargs perl px.perl
    Signed-off-by: Junio C Hamano <>
Commits on Aug 27, 2006
  1. @jonas

    Use PATH_MAX instead of MAXPATHLEN

    jonas authored Junio C Hamano committed
    According to sys/paramh.h it's a "BSD name" for values defined in
    <limits.h>. Besides PATH_MAX seems to be more commonly used.
    Signed-off-by: Jonas Fonseca <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 15, 2006
  1. Make checkout_all void.

    David Rientjes authored Junio C Hamano committed
    Signed-off-by: David Rientjes <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 13, 2006
  1. Merge branch 'mk/rename'

    Junio C Hamano authored
Commits on Aug 4, 2006
  1. Make git-checkout-index a builtin

    Junio C Hamano authored
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.