1. 19 Dec, 2012 1 commit
  2. 17 Dec, 2012 2 commits
  3. 10 Dec, 2012 2 commits
    • Fix iterator reset and add reset ranges · 91e7d263
      The `git_iterator_reset` command has not been working in all cases
      particularly when there is a start and end range.  This fixes it
      and adds tests for it, and also extends it with the ability to
      update the start/end range strings when an iterator is reset.
      Russell Belfer committed
    • Clean up iterator APIs · 9950d27a
      This removes the need to explicitly pass the repo into iterators
      where the repo is implied by the other parameters.  This moves
      the repo to be owned by the parent struct.  Also, this has some
      iterator related updates to the internal diff API to lay the
      groundwork for checkout improvements.
      Russell Belfer committed
  4. 01 Dec, 2012 1 commit
  5. 30 Nov, 2012 2 commits
  6. 28 Nov, 2012 1 commit
  7. 27 Nov, 2012 3 commits
  8. 23 Nov, 2012 1 commit
    • Reset all static variables to NULL in clar's __cleanup · 9094d30b
      Without this change, any failed assertion in the second (or a later) test
      inside a test suite has a chance of double deleting memory, resulting in
      a heap corruption. See #1096 for details.
      
      This leaves alone the test cases where we "just" use cl_git_sandbox_init()
      and cl_git_sandbox_cleanup(). These methods already take good care to not
      double delete a repository.
      
      Fixes #1096
      Sascha Cunz committed
  9. 20 Nov, 2012 1 commit
    • Improve iterator ignoring .git file · d46b0a04
      The workdir iterator has always tried to ignore .git files, but
      it turns out there were some bugs.  This makes it more robust at
      ignoring .git files.
      
      This also makes iterators always check ".git" case insensitively
      regardless of the properties of the system.  This will make libgit2
      skip ".GIT" and the like.  This is different from core git, but on
      systems with case insensitive but case preserving file systems,
      allowing ".GIT" to be added is problematic.
      Russell Belfer committed
  10. 15 Nov, 2012 3 commits
  11. 30 Oct, 2012 1 commit
    • Move rename detection into new file · db106d01
      This improves the naming for the rename related functionality
      moving it to be called `git_diff_find_similar()` and renaming
      all the associated constants, etc. to make more sense.
      
      I also moved the new code (plus the existing `git_diff_merge`)
      into a new file `diff_tform.c` where I can put new functions
      related to manipulating git diff lists.
      
      This also updates the implementation significantly from the
      last revision fixing some ordering issues (where break-rewrite
      needs to be handled prior to copy and rename detection) and
      improving config option handling.
      Russell Belfer committed
  12. 25 Oct, 2012 1 commit
  13. 23 Oct, 2012 1 commit
    • Initial implementation of diff rename detection · b4f5bb07
      This implements the basis for diff rename and copy detection,
      although it is based on simple SHA comparison right now instead
      of using a matching algortihm.  Just as `git_diff_merge` can be
      used as a post-pass on diffs to emulate certain command line
      behaviors, there is a new API `git_diff_detect` which will
      update a diff list in-place, adjusting some deltas to RENAMED
      or COPIED state (and also, eventually, splitting MODIFIED deltas
      where the change is too large into DELETED/ADDED pairs).
      
      This also adds a new test repo that will hold rename/copy/split
      scenarios.  Right now, it just has exact-match rename and copy,
      but the tests are written to use tree diffs, so we should be able
      to add new test scenarios easily without breaking tests.
      Russell Belfer committed
  14. 18 Oct, 2012 1 commit
  15. 15 Oct, 2012 1 commit
    • Fix single-file ignore checks · 52032ae5
      To answer if a single given file should be ignored, the path to
      that file has to be processed progressively checking that there
      are no intermediate ignored directories in getting to the file
      in question.  This enables that, fixing the broken old behavior,
      and adds tests to exercise various ignore situations.
      Russell Belfer committed
  16. 09 Oct, 2012 1 commit
    • Add complex checkout test and then fix checkout · 0d64bef9
      This started as a complex new test for checkout going through the
      "typechanges" test repository, but that revealed numerous issues
      with checkout, including:
      
      * complete failure with submodules
      * failure to create blobs with exec bits
      * problems when replacing a tree with a blob because the tree
        "example/" sorts after the blob "example" so the delete was
        being processed after the single file blob was created
      
      This fixes most of those problems and includes a number of other
      minor changes that made it easier to do that, including improving
      the TYPECHANGE support in diff/status, etc.
      Russell Belfer committed
  17. 08 Oct, 2012 2 commits
  18. 28 Sep, 2012 1 commit
  19. 25 Sep, 2012 3 commits
    • Add const to all shared pointers in diff API · bae957b9
      There are a lot of places where the diff API gives the user access
      to internal data structures and many of these were being exposed
      through non-const pointers.  This replaces them all with const
      pointers for any object that the user can access but is still
      owned internally to the git_diff_list or git_diff_patch objects.
      
      This will probably break some bindings...  Sorry!
      Russell Belfer committed
    • Fix bugs in new diff patch code · 64286308
      This fixes all the bugs in the new diff patch code.  The only
      really interesting one is that when we merge two diffs, we now
      have to actually exclude diff delta records that are not supposed
      to be tracked, as opposed to before where they could be included
      because they would be skipped silently by `git_diff_foreach()`.
      Other than that, there are just minor errors.
      Russell Belfer committed
    • Initial implementation of new diff patch API · 5f69a31f
      Replacing the `git_iterator` object, this creates a simple API
      for accessing the "patch" for any file pair in a diff list and
      then gives indexed access to the hunks in the patch and the lines
      in the hunk.  This is the initial implementation of this revised
      API - it is still broken, but at least builds cleanly.
      Russell Belfer committed
  20. 13 Sep, 2012 1 commit
  21. 11 Sep, 2012 1 commit
    • Fix diff binary file detection · 1f35e89d
      In the process of adding tests for the max file size threshold
      (which treats files over a certain size as binary) there seem to
      be a number of problems in the new code with detecting binaries.
      This should fix those up, as well as add a test for the file
      size threshold stuff.
      
      Also, this un-deprecates `GIT_DIFF_LINE_ADD_EOFNL`, since I
      finally found a legitimate situation where it would be returned.
      Russell Belfer committed
  22. 10 Sep, 2012 1 commit
    • 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
  23. 05 Sep, 2012 1 commit
    • Diff iterators · f335ecd6
      This refactors the diff output code so that an iterator object
      can be used to traverse and generate the diffs, instead of just
      the `foreach()` style with callbacks.  The code has been rearranged
      so that the two styles can still share most functions.
      
      This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses
      that as a common error code for marking the end of iteration when
      using a iterator style of object.
      Russell Belfer committed
  24. 22 Aug, 2012 1 commit
    • Minor bug fixes in diff code · 5fdc41e7
      In looking at PR #878, I found a few small bugs in the diff code,
      mostly related to work that can be avoided when processing tree-
      to-tree diffs that was always being carried out.  This commit has
      some small fixes in it.
      Russell Belfer committed
  25. 04 Aug, 2012 1 commit
    • Update iterators for consistency across library · 5dca2010
      This updates all the `foreach()` type functions across the library
      that take callbacks from the user to have a consistent behavior.
      The rules are:
      
      * A callback terminates the loop by returning any non-zero value
      * Once the callback returns non-zero, it will not be called again
        (i.e. the loop stops all iteration regardless of state)
      * If the callback returns non-zero, the parent fn returns GIT_EUSER
      * Although the parent returns GIT_EUSER, no error will be set in
        the library and `giterr_last()` will return NULL if called.
      
      This commit makes those changes across the library and adds tests
      for most of the iteration APIs to make sure that they follow the
      above rules.
      Russell Belfer committed
  26. 24 Jul, 2012 1 commit
  27. 19 Jul, 2012 1 commit
  28. 02 Jul, 2012 1 commit
  29. 19 Jun, 2012 1 commit
  30. 08 Jun, 2012 1 commit
    • Minor fixes, cleanups, and clarifications · 145e696b
      There are three actual changes in this commit:
      
      1. When the trailing newline of a file is removed in a diff, the
         change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
         to the callback.  Previously, the `ADD_EOFNL` constant was given
         which was just an error in my understanding of when the various
         circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
         should never be generated.  A new newline is simply an `ADD`.
      2. Rewrote the `diff_delta__merge_like_cgit` function that contains
         the core logic of the `git_diff_merge` implementation.  The new
         version doesn't actually have significantly different behavior,
         but the logic should be much more obvious, I think.
      3. Fixed a bug in `git_diff_merge` where it freed a string pool
         while some of the string data was still in use.  This led to
         `git_diff_print_patch` accessing memory that had been freed.
      
      The rest of this commit contains improved documentation in `diff.h`
      to make the behavior and the equivalencies with core git clearer,
      and a bunch of new tests to cover the various cases, oh and a minor
      simplification of `examples/diff.c`.
      Russell Belfer committed