1. 14 Sep, 2012 8 commits
  2. 13 Sep, 2012 1 commit
  3. 14 Sep, 2012 2 commits
  4. 13 Sep, 2012 10 commits
  5. 12 Sep, 2012 2 commits
    • odb_pack: try lookup before refreshing packs · ab8a0402
      This reduces the rate of syscalls for the common case of sequences of
      object reads from the same pack.
      
      Best of 5 timings for libgit2_clar before this patch:
      real    0m5.375s
      user    0m0.392s
      sys     0m3.564s
      
      After applying this patch:
      real    0m5.285s
      user    0m0.356s
      sys     0m3.544s
      
      0.6% improvement in system time.
      9.2% improvement in user time.
      1.7% improvement in elapsed time.
      
      Confirmed a 0.6% reduction in number of system calls with strace.
      
      Expect greater improvement for graph-traversal with large packs.
      David Michael Barr committed
    • Add tests and improve param checks · a13fb55a
      Fixed some minor `git_repository_hashfile` issues:
      
      - Fixed incorrect doc (saying that repo could be NULL)
      - Added checking of object type value to acceptable ones
      - Added more tests for various parameter permutations
      Russell Belfer committed
  6. 11 Sep, 2012 9 commits
  7. 10 Sep, 2012 3 commits
    • Reorg internal odb read header and object lookup · c6ac28fd
      Often `git_odb_read_header` will "fail" and have to read the
      entire object into memory instead of just the header.  When this
      happens, the object is loaded and then disposed of immediately,
      which makes it difficult to efficiently use the header information
      to decide if the object should be loaded (since attempting to do
      so will often result in loading the object twice).
      
      This commit takes the existing code and reorganizes it to have
      two new functions:
      
      - `git_odb__read_header_or_object` which acts just like the old
        read header function except that it returns the object, too, if
        it was forced to load the whole thing.  It then becomes the
        callers responsibility to free the `git_odb_object`.
      - `git_object__from_odb_object` which was extracted from the old
        `git_object_lookup` and creates a subclass of `git_object` from
        an existing `git_odb_object` (separating the ODB lookup from the
        `git_object` creation).  This allows you to use the first header
        reading function efficiently without instantiating the
        `git_odb_object` twice.
      
      There is no net change to the behavior of any of the existing
      functions, but this allows internal code to tap into the ODB
      lookup and object creation to be more efficient.
      Russell Belfer committed
    • Move diff max_size to public API · e597b189
      This commit adds a max_size value in the public `git_diff_options`
      structure so that the user can automatically flag blobs over a
      certain size as binary regardless of other properties.
      
      Also, and perhaps more importantly, this moves binary detection
      to be as early as possible in the diff traversal inner loop and
      makes sure that we stop loading objects as soon as we decide that
      they are binary.
      Russell Belfer committed
    • Replace git_diff_iterator_num_files with progress · b36effa2
      The `git_diff_iterator_num_files` API was problematic, since we
      don't actually know the exact number of files to be iterated over
      until we load those files into memory.  This replaces it with a
      new `git_diff_iterator_progress` API that goes from 0 to 1, and
      moves and renamed the old API for the internal places that can
      tolerate a max value instead of an exact value.
      Russell Belfer committed
  8. 09 Sep, 2012 1 commit
  9. 07 Sep, 2012 1 commit
  10. 06 Sep, 2012 3 commits
    • Clean up blob diff path · 3a3deea8
      Previously when diffing blobs, the diff code just ran with a NULL
      repository object. Of course, that's not necessary and the test
      for a NULL repo was confusing. This makes the blob diff run with
      the repo that contains the blobs and clarifies the test that it
      is possible to be diffing data where the path is unknown.
      Russell Belfer committed
    • Implement filters for status/diff blobs · 60b9d3fc
      This adds support to diff and status for running filters (a la crlf)
      on blobs in the workdir before computing SHAs and before generating
      text diffs.  This ended up being a bit more code change than I had
      thought since I had to reorganize some of the diff logic to minimize
      peak memory use when filtering blobs in a diff.
      
      This also adds a cap on the maximum size of data that will be loaded
      to diff.  I set it at 512Mb which should match core git.  Right now
      it is a #define in src/diff.h but it could be moved into the public
      API if desired.
      Russell Belfer committed
    • Better header comments · 8f9b6a13
      Russell Belfer committed