1. 26 9月, 2007 2 次提交
  2. 21 9月, 2007 6 次提交
    • P
      sq_quote_argv and add_to_string rework with strbuf's. · 7a33bcbe
      Pierre Habouzit 提交于
      * 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: NPierre Habouzit <madcoder@debian.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7a33bcbe
    • P
      Full rework of quote_c_style and write_name_quoted. · 663af342
      Pierre Habouzit 提交于
      * 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
      clipped.
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      663af342
    • P
      Rework unquote_c_style to work on a strbuf. · 7fb1011e
      Pierre Habouzit 提交于
      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
      functions.
      
      The quoting function is also made more efficient scanning for backslashes
      and treating portions of strings without a backslash at once.
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      7fb1011e
    • P
      strbuf API additions and enhancements. · c76689df
      Pierre Habouzit 提交于
      Add strbuf_remove, change strbuf_insert:
        As both are special cases of strbuf_splice, implement them as such.
        gcc is able to do the math and generate almost optimal code this way.
      
      Add strbuf_swap:
        Exchange the values of its arguments.
        Use it in fast-import.c
      
      Also fix spacing issues in strbuf.h
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      c76689df
    • P
      nfv?asprintf are broken without va_copy, workaround them. · 19247e55
      Pierre Habouzit 提交于
      * 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: NPierre Habouzit <madcoder@debian.org>
      19247e55
    • P
  3. 19 9月, 2007 13 次提交
  4. 18 9月, 2007 17 次提交
  5. 17 9月, 2007 2 次提交
    • J
      Merge branch 'maint' · acd69176
      Junio C Hamano 提交于
      * maint:
        git-apply: fix whitespace stripping
        apply --index-info: fall back to current index for mode changes
        core-tutorial: minor cleanup
        documentation: replace Discussion section by link to user-manual chapter
        user-manual: todo updates and cleanup
        user-manual: fix introduction to packfiles
        user-manual: move packfile and dangling object discussion
        user-manual: rewrite object database discussion
        user-manual: reorder commit, blob, tree discussion
        user-manual: rewrite index discussion
        user-manual: create new "low-level git operations" chapter
        user-manual: rename "git internals" to "git concepts"
        user-manual: move object format details to hacking-git chapter
        user-manual: adjust section levels in "git internals"
        revision walker: --cherry-pick is a limited operation
        git-sh-setup: typofix in comments
      acd69176
    • J
      git-apply: fix whitespace stripping · d7416eca
      J. Bruce Fields 提交于
      The algorithm isn't right here: it accumulates any set of 8 spaces into
      tabs even if they're separated by tabs, so
      
      	<four spaces><tab><four spaces><tab>
      
      is converted to
      
      	<tab><tab><tab>
      
      when it should be just
      
      	<tab><tab>
      
      So teach git-apply that a tab hides any group of less than 8 previous
      spaces in a row.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d7416eca