1. 26 May, 2016 1 commit
  2. 23 Nov, 2015 1 commit
    • checkout: only consider nsecs when built that way · 25e84f95
      When examining the working directory and determining whether it's
      up-to-date, only consider the nanoseconds in the index entry when
      built with `GIT_USE_NSEC`.  This prevents us from believing that
      the working directory is always dirty when the index was originally
      written with a git client that uinderstands nsecs (like git 2.x).
      Edward Thomson committed
  3. 26 Jun, 2015 1 commit
  4. 23 Jun, 2015 2 commits
    • stash: save the workdir file when deleted in index · 90177111
      When stashing the workdir tree, examine the index as well.  Using
      a mechanism similar to `git_diff_tree_to_workdir_with_index`
      allows us to determine that a file was added in the index and
      subsequently modified in the working directory.  Without examining
      the index, we would erroneously believe that this file was
      untracked and fail to include it in the working directory tree.
      
      Use a slightly modified `git_diff_tree_to_workdir_with_index` in
      order to avoid some of the behavior custom to `git diff`.  In
      particular, be sure to include the working directory side of a
      file when it was deleted in the index.
      Edward Thomson committed
  5. 20 Jun, 2015 1 commit
  6. 02 May, 2014 5 commits
  7. 15 Apr, 2014 1 commit
  8. 25 Jan, 2014 1 commit
  9. 01 Nov, 2013 1 commit
  10. 11 Oct, 2013 1 commit
  11. 25 Jul, 2013 1 commit
    • Make rename detection file size fix better · effdbeb3
      The previous fix for checking file sizes with rename detection
      always loads the blob.  In this version, if the odb backend can
      get the object header without loading the whole thing into memory,
      then we'll just use that, so that we can eliminate possible rename
      sources & targets without loading them.
      Russell Belfer committed
  12. 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
  13. 10 Jul, 2013 1 commit
    • 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
  14. 17 Jun, 2013 2 commits
    • More tests and bug fixes for status with rename · a1683f28
      This changes the behavior of the status RENAMED flags so that they
      will be combined with the MODIFIED flags if appropriate.  If a file
      is modified in the index and also renamed, then the status code
      will have both the GIT_STATUS_INDEX_MODIFIED and INDEX_RENAMED bits
      set.  If it is renamed but the OID has not changed, then just the
      GIT_STATUS_INDEX_RENAMED bit will be set.  Similarly, the flags
      GIT_STATUS_WT_MODIFIED and GIT_STATUS_WT_RENAMED can both be set
      independently of one another.
      
      This fixes a serious bug where the check for unmodified files that
      was done at data load time could end up erasing the RENAMED state
      of a file that was renamed with no changes.
      
      Lastly, this contains a bunch of new tests for status with renames,
      including tests where the only rename changes are case changes.
      The expected results of these tests have to vary by whether the
      platform uses a case sensitive filesystem or not, so the expected
      data covers those platform differences separately.
      Russell Belfer committed
    • Improve case handling in git_diff__paired_foreach · 351888cf
      This commit reinstates some changes to git_diff__paired_foreach
      that were discarded during the rebase (because the diff_output.c
      file had gone away), and also adjusts the case insensitively
      logic slightly to hopefully deal with either mismatched icase
      diffs and other case insensitivity scenarios.
      Russell Belfer committed
  15. 10 Jun, 2013 1 commit
    • 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
  16. 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
  17. 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
  18. 07 May, 2013 1 commit
    • Add GIT_DIFF_LINE_CONTEXT_EOFNL · e35e2684
      This adds a new line origin constant for the special line that
      is used when both files end without a newline.
      
      In the course of writing the tests for this, I was having problems
      with modifying a file but not having diff notice because it was
      the same size and modified less than one second from the start of
      the test, so I decided to start working on nanosecond timestamp
      support.  This commit doesn't contain the nanosecond support, but
      it contains the reorganization of maybe_modified and the hooks so
      that if the nanosecond data were being read by stat() (or rather
      being copied by git_index_entry__init_from_stat), then the nsec
      would be taken into account.
      
      This new stuff could probably use some more tests, although there
      is some amount of it here.
      Russell Belfer committed
  19. 30 Apr, 2013 1 commit
  20. 20 Feb, 2013 1 commit
    • Replace diff delta binary with flags · 71a3d27e
      Previously the git_diff_delta recorded if the delta was binary.
      This replaces that (with no net change in structure size) with
      a full set of flags.  The flag values that were already in use
      for individual git_diff_file objects are reused for the delta
      flags, too (along with renaming those flags to make it clear that
      they are used more generally).
      
      This (a) makes things somewhat more consistent (because I was
      using a -1 value in the "boolean" binary field to indicate unset,
      whereas now I can just use the flags that are easier to understand),
      and (b) will make it easier for me to add some additional flags to
      the delta object in the future, such as marking the results of a
      copy/rename detection or other deltas that might want a special
      indicator.
      
      While making this change, I officially moved some of the flags that
      were internal only into the private diff header.
      
      This also allowed me to remove a gross hack in rename/copy detect
      code where I was overwriting the status field with an internal
      value.
      Russell Belfer committed
  21. 08 Jan, 2013 1 commit
  22. 10 Dec, 2012 1 commit
    • 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
  23. 01 Dec, 2012 1 commit
  24. 30 Nov, 2012 1 commit
  25. 15 Nov, 2012 2 commits
  26. 09 Nov, 2012 2 commits
    • Fix various cross-platform build issues · 0f3def71
      This fixes a number of warnings and problems with cross-platform
      builds.  Among other things, it's not safe to name a member of a
      structure "strcmp" because that may be #defined.
      Russell Belfer committed
    • Some diff refactorings to help code reuse · 55cbd05b
      There are some diff functions that are useful in a rewritten
      checkout and this lays some groundwork for that.  This contains
      three main things:
      
      1. Share the function diff uses to calculate the OID for a file
         in the working directory (now named `git_diff__oid_for_file`
      2. Add a `git_diff__paired_foreach` function to iterator over
         two diff lists concurrently.  Convert status to use it.
      3. Move all the string/prefix/index entry comparisons into
         function pointers inside the `git_diff_list` object so they
         can be switched between case sensitive and insensitive
         versions.  This makes them easier to reuse in various
         functions without replicating logic.  As part of this, move
         a couple of index functions out of diff.c and into index.c.
      Russell Belfer committed
  27. 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
  28. 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
  29. 17 Oct, 2012 1 commit
    • Fix minor bugs · 52a61bb8
      Fixed no-submodule speedup of new checkout code.  Fixed missing
      final update to progress (which may go away, I realize).  Fixed
      unused structure in header and incorrect comment.
      Russell Belfer committed
  30. 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