1. 29 Jun, 2013 1 commit
  2. 24 Jun, 2013 1 commit
  3. 18 Jun, 2013 3 commits
  4. 17 Jun, 2013 4 commits
  5. 14 Jun, 2013 1 commit
  6. 11 Jun, 2013 1 commit
    • Implement regex pattern diff driver · 5dc98298
      This implements the loading of regular expression pattern lists
      for diff drivers that search for function context in that way.
      This also changes the way that diff drivers update options and
      interface with xdiff APIs to make them a little more flexible.
      Russell Belfer committed
  7. 10 Jun, 2013 2 commits
    • Reorganize diff and add basic diff driver · 114f5a6c
      This is a significant reorganization of the diff code to break it
      into a set of more clearly distinct files and to document the new
      organization.  Hopefully this will make the diff code easier to
      understand and to extend.
      
      This adds a new `git_diff_driver` object that looks of diff driver
      information from the attributes and the config so that things like
      function content in diff headers can be provided.  The full driver
      spec is not implemented in the commit - this is focused on the
      reorganization of the code and putting the driver hooks in place.
      
      This also removes a few #includes from src/repository.h that were
      overbroad, but as a result required extra #includes in a variety
      of places since including src/repository.h no longer results in
      pulling in the whole world.
      Russell Belfer committed
  8. 23 May, 2013 2 commits
    • Fill out diff rename test coverage · 49f70f2c
      This extends the rename tests to make sure that every rename
      scenario in the inner loop of git_diff_find_similar is actually
      exercised.  Also, fixes an incorrect assert that was in one of
      the clauses that was not previously being exercised.
      Russell Belfer committed
    • 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
  9. 22 May, 2013 1 commit
    • Significant rename detection rewrite · a21cbb12
      This flips rename detection around so instead of creating a
      forward mapping from deltas to possible rename targets, instead
      it creates a reverse mapping, looking at possible targets and
      trying to find a source that they could have been renamed or
      copied from.  This is important because each output can only
      have a single source, but a given source could map to multiple
      outputs (in the form of COPIED records).
      
      Additionally, this makes a couple of tweaks to the public rename
      detection APIs, mostly renaming a couple of options that control
      the behavior to make more sense and to be more like core Git.
      
      I walked through the tests looking at the exact results and
      updated the expectations based on what I saw.  The new code is
      different from the old because it cannot give some nonsense
      results (like A was renamed to both B and C) which were part of
      the outputs previously.
      Russell Belfer committed
  10. 20 May, 2013 1 commit
    • Add more diff rename detection tests · 4742148d
      This adds a bunch more rename detection tests including checks
      vs the working directory, the new exact match options, some more
      whitespace variants, etc.
      
      This also adds a git_futils_writebuffer helper function and uses
      it in checkout.  This is mainly added because I wanted an easy
      way to write out a git_buf to disk inside my test code.
      Russell Belfer committed
  11. 18 May, 2013 1 commit
    • Fix issues with git_diff_find_similar · d958e37a
      There are a number of bugs in the rename code that only were
      obvious when I started testing it against large old repos with
      more complex patterns.  (The code to do that testing is not ready
      to merge with libgit2, but I do plan to add more thorough tests.)
      
      This contains a significant number of changes and also tweaks the
      public API slightly to make emulating core git easier.
      
      Most notably, this separates the GIT_DIFF_FIND_AND_BREAK_REWRITES
      flag into FIND_REWRITES (which adds a self-similarity score to
      every modified file) and BREAK_REWRITES (which splits the modified
      deltas into add/remove pairs in the diff list).  When you do a raw
      output of core git, rewrites show up as M090 or such, not at A and
      D output, so I wanted to be able to emulate that.
      
      Publicly, this also changes the flags to be uint16_t since we
      don't need values out of that range.
      
      Internally, this contains significant changes from a number of
      small bug fixes (like using the wrong side of the diff to decide
      if the object could be found in the ODB vs the workdir) to larger
      issues about which files can and should be compared and how the
      various edge cases of similarity scores should be treated.
      
      Honestly, I don't think this is the last update that will have to
      be made to this code, but I think this moves us closer to correct
      behavior and I tried to document the code so it would be easier
      to follow..
      Russell Belfer committed
  12. 14 May, 2013 1 commit
  13. 10 May, 2013 1 commit
    • Fix diff output for renames and copies · e9ba61f3
      If you use rename detection, the renamed and copied files would
      not show any text diffs because the function that decides if
      data should be loaded didn't know which sides of the diff to
      load for those cases.
      
      This adds a test that looks at the patch generated for diff
      entries that are COPIED or RENAMED.
      Russell Belfer committed
  14. 11 Mar, 2013 1 commit
  15. 03 Mar, 2013 1 commit
    • Fix a few leaks · 323bb885
      `git_diff_get_patch()` would unconditionally load the patch object and
      then simply leak it if the user hadn't requested it. Short-circuit
      loading the object if the user doesn't want it.
      
      The rest of the plugs are simply calling the free functions of objects
      allocated during the tests.
      Carlos Martín Nieto committed
  16. 22 Feb, 2013 3 commits
    • More rename detection tests · 1be4ba98
      This includes tests for crlf changes, whitespace changes with the
      default comparison and with the ignore whitespace comparison, and
      more sensitivity checking for the comparison code.
      Russell Belfer committed
    • Fix tests for find_similar and related · 6f9d5ce8
      This fixes both a test that I broke in diff::patch where I was
      relying on the current state of the working directory for the
      renames test data and fixes an unstable test in diff::rename
      where the environment setting for the "diff.renames" config was
      being allowed to influence the test results.
      Russell Belfer committed
    • Add diff rename tests with partial similarity · d4b747c1
      This adds some new tests that actually exercise the similarity
      metric between files to detect renames, copies, and split modified
      files that are too heavily modified.
      
      There is still more testing to do - these tests are just partially
      covering the cases.
      
      There is also one bug fix in this where a change set with only
      MODIFY being broken into ADD/DELETE (due to low self-similarity)
      without any additional RENAMED entries would end up not processing
      the split requests (because the num_rewrites counter got reset).
      Russell Belfer committed
  17. 30 Nov, 2012 2 commits
  18. 27 Nov, 2012 2 commits
  19. 15 Nov, 2012 1 commit
  20. 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
  21. 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