1. 05 Aug, 2013 1 commit
  2. 04 Aug, 2013 3 commits
  3. 31 Jul, 2013 1 commit
    • Major rename detection changes · d730d3f4
      After doing further profiling, I found that a lot of time was
      being spent attempting to insert hashes into the file hash
      signature when using the rolling hash because the rolling hash
      approach generates a hash per byte of the file instead of one
      per run/line of data.
      
      To optimize this, I decided to convert back to a run-based file
      signature algorithm which would be more like core Git.
      
      After changing this, a number of the existing tests started to
      fail.  In some cases, this appears to have been because the test
      was coded to be too specific to the particular results of the file
      similarity metric and in some cases there appear to have been bugs
      in the core rename detection code where only by the coincidence
      of the file similarity scoring were the expected results being
      generated.
      
      This renames all the variables in the core rename detection code
      to be more consistent and hopefully easier to follow which made it
      a bit easier to reason about the behavior of that code and fix the
      problems that I was seeing.  I think it's in better shape now.
      
      There are a couple of tests now that attempt to stress test the
      rename detection code and they are quite slow.  Most of the time
      is spent setting up the test data on disk and in the index.  When
      we roll out performance improvements for index insertion, it
      should also speed up these tests I hope.
      Russell Belfer committed
  4. 25 Jul, 2013 1 commit
    • Fix rename detection for tree-to-tree diffs · a5140f4d
      The performance improvements I introduced for rename detection
      were not able to run successfully for tree-to-tree diffs because
      the blob size was not known early enough and so the file signature
      always had to be calculated nonetheless.
      
      This change separates loading blobs into memory from calculating
      the signature.  I can't avoid having to load the large blobs into
      memory, but by moving it forward, I'm able to avoid the signature
      calculation if the blob won't come into play for renames.
      Russell Belfer committed
  5. 24 Jul, 2013 1 commit
  6. 23 Jul, 2013 1 commit
    • Add hunk/file headers to git_diff_patch_size · 197b8966
      This allows git_diff_patch_size to account for hunk headers and
      file headers in the returned size.  This required some refactoring
      of the code that is used to print file headers so that it could be
      invoked by the git_diff_patch_size API.
      
      Also this increases the test coverage and fixes an off-by-one bug
      in the size calculation when newline changes happen at the end of
      the file.
      Russell Belfer committed
  7. 22 Jul, 2013 1 commit
  8. 13 Jul, 2013 1 commit
  9. 11 Jul, 2013 1 commit
  10. 10 Jul, 2013 11 commits
    • Untracked directories with .git should be ignored · 125655fe
      This restores a behavior that was accidentally lost during some
      diff refactoring where an untracked directory that contains a .git
      item should be treated as IGNORED, not as UNTRACKED.  The submodule
      code already detects this, but the diff code was not handling the
      scenario right.
      
      This also updates a number of existing tests that were actually
      exercising the behavior but did not have the right expectations in
      place.  It actually makes the new
      `test_diff_submodules__diff_ignore_options` test feel much better
      because the "not-a-submodule" entries are now ignored instead of
      showing up as untracked items.
      
      Fixes #1697
      Russell Belfer committed
    • Add ignore_submodules to diff options · f9775a37
      This adds correct support for an equivalent to --ignore-submodules
      in diff, where an actual ignore value can be passed to diff to
      override the per submodule settings in the configuration.
      
      This required tweaking the constants for ignore values so that
      zero would not be used and could represent an unset option to the
      diff.  This was an opportunity to move the submodule values into
      include/git2/types.h and to rename the poorly named DEFAULT values
      for ignore and update constants to RESET instead.
      
      Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as
      setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL
      (which is actually a minor change from the old behavior in that
      submodules will now be treated as UNMODIFIED deltas instead of
      being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED).
      
      This includes tests for the various new settings.
      Russell Belfer committed
    • Update diff to new internal submodule status API · 2e3e273e
      Submodules now expose an internal status API that allows diff to
      get back the OID values from the submodule very easily and also
      to avoiding caching issues and to override the ignore setting for
      the submodule.
      Russell Belfer committed
    • Add timestamp check to submodule status · e807860f
      This is probably not the final form of this change, but this is
      a preliminary version of checking a timestamp to see if the cached
      working directory HEAD OID matches the current.  Right now, this
      uses the timestamp on the index and is, like most of our timestamp
      checking, subject to having only second accuracy.
      Russell Belfer committed
    • More diff submodule tests for cache issues · 4535f044
      The submodules code caches data about submodules in a way that
      can cause problems.  This adds some tests that try making various
      modifications to the state of a submodule to see where we can
      catch out problems in the submodule caching.
      
      Right now, I've put in an extra git_submodule_reload_all so that
      the test will pass, but with that commented out, the test fails.
      I'm working on fixing the broken version of the test at which
      point I'll commit the fix and delete the extra reload that makes
      the test pass.
      Russell Belfer committed
    • More improvements to submodule diff tests · 12f8fe00
      This controls for the diff.mnemonicprefix setting so that can't
      break the tests.  Also, this expands one test to emulate an
      ObjectiveGit test more closely.
      Russell Belfer committed
    • Add git_pathspec_match_diff API · 2b672d5b
      This adds an additional pathspec API that will match a pathspec
      against a diff object.  This is convenient if you want to handle
      renames (so you need the whole diff and can't use the pathspec
      constraint built into the diff API) but still want to tell if the
      diff had any files that matched the pathspec.
      
      When the pathspec is matched against a diff, instead of keeping
      a list of filenames that matched, instead the API keeps the list
      of git_diff_deltas that matched and they can be retrieved via a
      new API git_pathspec_match_list_diff_entry.
      
      There are a couple of other minor API extensions here that were
      mostly for the sake of convenience and to reduce dependencies
      on knowing the internal data structure between files inside the
      library.
      Russell Belfer committed
  11. 05 Jul, 2013 1 commit
    • Diff hunk context off by one on long lines · a5f9b5f8
      The diff hunk context string that is returned to xdiff need not
      be NUL terminated because the xdiff code just copies the number of
      bytes that you report directly into the output.  There was an off
      by one in the diff driver code when the header context was longer
      than the output buffer size, the output buffer length included
      the NUL byte which was copied into the hunk header.
      
      Fixes #1710
      Russell Belfer committed
  12. 29 Jun, 2013 1 commit
  13. 27 Jun, 2013 1 commit
  14. 26 Jun, 2013 1 commit
  15. 24 Jun, 2013 1 commit
  16. 20 Jun, 2013 1 commit
  17. 18 Jun, 2013 4 commits
    • Fix rename looped reference issues · e4acc3ba
      This makes the diff rename tracking code more careful about the
      order in which it processes renames and more thorough in updating
      the mapping of correct renames when an earlier rename update
      alters the index of a later matched pair.
      Russell Belfer committed
    • Add "as_path" parameters to blob and buffer diffs · 74ded024
      This adds parameters to the four functions that allow for blob-to-
      blob and blob-to-buffer differencing (either via callbacks or by
      making a git_diff_patch object).  These parameters let you say
      that filename we should pretend the blob has while doing the diff.
      If you pass NULL, there should be no change from the existing
      behavior, which is to skip using attributes for file type checks
      and just look at content.  With the parameters, you can plug into
      the new diff driver functionality and get binary or non-binary
      behavior, plus function context regular expressions, etc.
      
      This commit also fixes things so that the git_diff_delta that is
      generated by these functions will actually be populated with the
      data that we know about the blobs (or buffers) so you can use it
      appropriately.  It also fixes a bug in generating patches from
      the git_diff_patch objects created via these functions.
      
      Lastly, there is one other behavior change that may matter.  If
      there is no difference between the two blobs, these functions no
      longer generate any diff callbacks / patches unless you have
      passed in GIT_DIFF_INCLUDE_UNMODIFIED.  This is pretty natural,
      but could potentially change the behavior of existing usage.
      Russell Belfer committed
  18. 17 Jun, 2013 4 commits
  19. 14 Jun, 2013 1 commit
  20. 12 Jun, 2013 3 commits