1. 23 May, 2013 1 commit
    • More diff rename tests; better split swap handling · 67db583d
      This adds a couple more tests of different rename scenarios.
      
      Also, this fixes a problem with the case where you have two
      "split" deltas and the left half of one matches the right half of
      the other.  That case was already being handled, but in the wrong
      order in a way that could result in bad output.  Also, if the swap
      also happened to put the other two halves into the correct place
      (i.e. two files exchanged places with each other), then the second
      delta was left with the SPLIT flag set when it really should be
      cleared.
      Russell Belfer committed
  2. 30 Apr, 2013 1 commit
  3. 26 Mar, 2013 1 commit
    • Fix some diff ignores and submodule dirty workdir · ccfa6805
      This started out trying to look at the problems from issue #1425
      and gradually grew to a broader set of fixes.  There are two core
      things fixed here:
      
      1. When you had an ignore like "/bin" which is rooted at the top
         of your tree, instead of immediately adding the "bin/" entry
         as an ignored item in the diff, we were returning all of the
         direct descendants of the directory as ignored items.  This
         changes things to immediately ignore the directory.  Note that
         this effects the behavior in test_status_ignore__subdirectories
         so that we no longer exactly match core gits ignore behavior,
         but the new behavior probably makes more sense (i.e. we now
         will include an ignored directory inside an untracked directory
         that we previously would have left off).
      2. When a submodule only contained working directory changes, the
         diff code was always considering it unmodified which was just
         an outright bug. The HEAD SHA of the submodule matches the SHA
         in the parent repo index, and since the SHAs matches, the diff
         code was overwriting the actual status with UNMODIFIED.
      
      These fixes broke existing tests test_diff_workdir__submodules and
      test_status_ignore__subdirectories but looking it over, I actually
      think the new results are correct and the old results were wrong.
      @nulltoken had actually commented on the subdirectory ignore issue
      previously.
      
      I also included in the tests some debugging versions of the
      shared iteration callback routines that print status or diff
      information.  These aren't used actively in the tests, but can be
      quickly swapped in to test code to give a better picture of what
      is being scanned in some of the complex test scenarios.
      Russell Belfer committed
  4. 07 Feb, 2013 1 commit
    • diff: add a notify callback to `git_diff__from_iterators` · 0d64ba48
      The callback will be called for each file, just before the `git_delta_t` gets inserted into the diff list.
      
      When the callback:
      - returns < 0, the diff process will be aborted
      - returns > 0, the delta will not be inserted into the diff list, but the diff process continues
      - returns 0, the delta is inserted into the diff list, and the diff process continues
      yorah committed
  5. 01 Dec, 2012 1 commit
  6. 30 Nov, 2012 1 commit
  7. 27 Nov, 2012 2 commits
  8. 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
  9. 08 Oct, 2012 1 commit
  10. 25 Sep, 2012 1 commit
    • 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
  11. 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
  12. 07 May, 2012 2 commits
  13. 30 Apr, 2012 1 commit
  14. 02 Mar, 2012 3 commits
    • Update diff to use iterators · 74fa4bfa
      This is a major reorganization of the diff code.  This changes
      the diff functions to use the iterators for traversing the
      content.  This allowed a lot of code to be simplified.  Also,
      this moved the functions relating to outputting a diff into a
      new file (diff_output.c).
      
      This includes a number of other changes - adding utility
      functions, extending iterators, etc. plus more tests for the
      diff code.  This also takes the example diff.c program much
      further in terms of emulating git-diff command line options.
      Russell Belfer committed
    • Continue implementation of git-diff · a2e895be
      * Implemented git_diff_index_to_tree
      * Reworked git_diff_options structure to handle more options
      * Made most of the options in git_diff_options actually work
      * Reorganized code a bit to remove some redundancy
      * Added option parsing to examples/diff.c to test most options
      Russell Belfer committed
    • Clean up diff implementation for review · 3a437590
      This fixes several bugs, updates tests and docs, eliminates the
      FILE* assumption in favor of printing callbacks for the diff patch
      formatter helpers, and adds a "diff" example function that can
      perform a diff from the command line.
      Russell Belfer committed
  15. 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