1. 08 Jan, 2013 1 commit
  2. 28 Nov, 2012 1 commit
    • Consolidate text buffer functions · 7bf87ab6
      There are many scattered functions that look into the contents of
      buffers to do various text manipulations (such as escaping or
      unescaping data, calculating text stats, guessing if content is
      binary, etc).  This groups all those functions together into a
      new file and converts the code to use that.
      
      This has two enhancements to existing functionality.  The old
      text stats function is significantly rewritten and the BOM
      detection code was extended (although largely we can't deal with
      anything other than a UTF8 BOM).
      Russell Belfer committed
  3. 25 Oct, 2012 1 commit
  4. 14 Oct, 2012 1 commit
  5. 10 Oct, 2012 1 commit
  6. 24 Aug, 2012 1 commit
  7. 24 Jul, 2012 1 commit
  8. 11 Jul, 2012 2 commits
  9. 07 Jun, 2012 1 commit
  10. 17 May, 2012 3 commits
  11. 15 May, 2012 2 commits
    • Document git_buf_common_prefix · 2c833917
      This function fills in a git_buf with the common prefix of
      an array of strings, but let's make that a little more clear.
      Russell Belfer committed
    • Ranged iterators and rewritten git_status_file · 41a82592
      The goal of this work is to rewrite git_status_file to use the
      same underlying code as git_status_foreach.
      
      This is done in 3 phases:
      
      1. Extend iterators to allow ranged iteration with start and
         end prefixes for the range of file names to be covered.
      2. Improve diff so that when there is a pathspec and there is
         a common non-wildcard prefix of the pathspec, it will use
         ranged iterators to minimize excess iteration.
      3. Rewrite git_status_file to call git_status_foreach_ext
         with a pathspec that covers just the one file being checked.
      
      Since ranged iterators underlie the status & diff implementation,
      this is actually fairly efficient.  The workdir iterator does
      end up loading the contents of all the directories down to the
      single file, which should ideally be avoided, but it is pretty
      good.
      Russell Belfer committed
  12. 09 May, 2012 1 commit
  13. 03 May, 2012 1 commit
  14. 25 Apr, 2012 1 commit
    • Implement git_pool paged memory allocator · 2bc8fa02
      This adds a `git_pool` object that can do simple paged memory
      allocation with free for the entire pool at once.  Using this,
      you can replace many small allocations with large blocks that
      can then cheaply be doled out in small pieces.  This is best
      used when you plan to free the small blocks all at once - for
      example, if they represent the parsed state from a file or data
      stream that are either all kept or all discarded.
      
      There are two real patterns of usage for `git_pools`: either
      for "string" allocation, where the item size is a single byte
      and you end up just packing the allocations in together, or for
      "fixed size" allocation where you are allocating a large object
      (e.g. a `git_oid`) and you generally just allocation single
      objects that can be tightly packed.  Of course, you can use it
      for other things, but those two cases are the easiest.
      Russell Belfer committed
  15. 30 Mar, 2012 1 commit
  16. 16 Mar, 2012 1 commit
  17. 15 Mar, 2012 1 commit
    • Continue error conversion · deafee7b
      This converts blob.c, fileops.c, and all of the win32 files.
      Also, various minor cleanups throughout the code.  Plus, in
      testing the win32 build, I cleaned up a bunch (although not
      all) of the warnings with the 64-bit build.
      Russell Belfer committed
  18. 06 Mar, 2012 1 commit
    • error-handling: Repository · cb8a7961
      This also includes droping `git_buf_lasterror` because it makes no sense
      in the new system. Note that in most of the places were it has been
      dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so
      instead it should return a generic `-1` and obviously not throw
      anything.
      Vicent Martí committed
  19. 02 Mar, 2012 1 commit
  20. 27 Feb, 2012 3 commits
    • filter: Apply filters before writing a file to the ODB · 44b1ff4c
      Initial implementation. The relevant code is in `blob.c`: the blob write
      function has been split into smaller functions.
      
      	- Directly write a file to the ODB in streaming mode
      
      	- Directly write a symlink to the ODB in direct mode
      
      	- Apply a filter, and write a file to the ODB in direct mode
      
      When trying to write a file, we first call `git_filter__load_for_file`,
      which populates a filters array with the required filters based on the
      filename.
      
      If no filters are resolved to the filename, we can write to the ODB in
      streaming mode straight from disk. Otherwise, we load the whole file in
      memory and use double-buffering to apply the filter chain. We finish
      by writing the file as a whole to the ODB.
      Vicent Martí committed
    • buffer: Unify `git_fbuffer` and `git_buf` · 13224ea4
      This makes so much sense that I can't believe it hasn't been done
      before. Kill the old `git_fbuffer` and read files straight into
      `git_buf` objects.
      
      Also: In order to fully support 4GB files in 32-bit systems, the
      `git_buf` implementation has been changed from using `ssize_t` for
      storage and storing negative values on allocation failure, to using
      `size_t` and changing the buffer pointer to a magical pointer on
      allocation failure.
      
      Hopefully this won't break anything.
      Vicent Martí committed
  21. 21 Feb, 2012 1 commit
    • Uniform iterators for trees, index, and workdir · b6c93aef
      This create a new git_iterator type of object that provides a
      uniform interface for iterating over the index, an arbitrary
      tree, or the working directory of a repository.
      
      As part of this, git ignore support was extended to support
      push and pop of directory-based ignore files as the working
      directory is being traversed (so the array of ignores does
      not have to be recreated at each directory during traveral).
      
      There are a number of other small utility functions in buffer,
      path, vector, and fileops that are included in this patch
      that made the iterator implementation cleaner.
      Russell Belfer committed
  22. 13 Feb, 2012 1 commit
  23. 12 Jan, 2012 1 commit
    • Fix several memory issues · 1dbcc9fc
      This contains fixes for several issues discovered by MSVC and
      by valgrind, including some bad data access, some memory
      leakage (in where certain files were not being successfully
      added to the cache), and some code simplification.
      Russell Belfer committed
  24. 11 Jan, 2012 1 commit
    • Initial implementation of gitignore support · df743c7d
      Adds support for .gitignore files to git_status_foreach() and
      git_status_file().  This includes refactoring the gitattributes
      code to share logic where possible.  The GIT_STATUS_IGNORED flag
      will now be passed in for files that are ignored (provided they
      are not already in the index or the head of repo).
      Russell Belfer committed
  25. 14 Dec, 2011 2 commits
  26. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      This converts virtually all of the places that allocate GIT_PATH_MAX
      buffers on the stack for manipulating paths to use git_buf objects
      instead.  The patch is pretty careful not to touch the public API
      for libgit2, so there are a few places that still use GIT_PATH_MAX.
      
      This extends and changes some details of the git_buf implementation
      to add a couple of extra functions and to make error handling easier.
      
      This includes serious alterations to all the path.c functions, and
      several of the fileops.c ones, too.  Also, there are a number of new
      functions that parallel existing ones except that use a git_buf
      instead of a stack-based buffer (such as git_config_find_global_r
      that exists alongsize git_config_find_global).
      
      This also modifies the win32 version of p_realpath to allocate whatever
      buffer size is needed to accommodate the realpath instead of hardcoding
      a GIT_PATH_MAX limit, but that change needs to be tested still.
      Russell Belfer committed
  27. 30 Nov, 2011 3 commits
    • Optimized of git_buf_join. · 969d588d
      This streamlines git_buf_join and removes the join-append behavior,
      opting instead for a very compact join-replace of the git_buf contents.
      The unit tests had to be updated to remove the join-append tests and
      have a bunch more exhaustive tests added.
      Russell Belfer committed
    • Make initial value of git_buf ptr always be a valid empty string. · 309113c9
      Taking a page from core git's strbuf, this introduces git_buf_initbuf
      which is an empty string that is used to initialize the git_buf ptr
      value even for new buffers.  Now the git_buf ptr will always point to
      a valid NUL-terminated string.
      
      This change required jumping through a few hoops for git_buf_grow
      and git_buf_free to distinguish between a actual allocated buffer
      and the global initial value.  Also, this moves the allocation
      related functions to be next to each other near the top of buffer.c.
      Russell Belfer committed
    • Make git_buf functions always maintain a valid cstr. · c63728cd
      At a tiny cost of 1 extra byte per allocation, this makes
      git_buf_cstr into basically a noop, which simplifies error
      checking when trying to convert things to use dynamic allocation.
      
      This patch also adds a new function (git_buf_copy_cstr) for copying
      the cstr data directly into an external buffer.
      Russell Belfer committed
  28. 28 Nov, 2011 3 commits
  29. 29 Oct, 2011 1 commit