1. 22 May, 2014 1 commit
  2. 02 May, 2014 1 commit
    • Lay groundwork for updating stat cache in diff · 0fc8e1f6
      This reorganized the diff OID calculation to make it easier to
      correctly update the stat cache during a diff once the flags to
      do so are enabled.
      
      This includes marking the path of a git_index_entry as const so
      we can make a "fake" git_index_entry with a "const char *" path
      and not get warnings.  I was a little surprised at how unobtrusive
      this change was, but I think it's probably a good thing.
      Russell Belfer committed
  3. 21 Apr, 2014 1 commit
  4. 17 Apr, 2014 10 commits
    • Fix race checking for existing index items · ea642d61
      In the threading tests, I was still seeing a race condition where
      the same item could end up being inserted multiple times into the
      index.  Preserving the sorted-ness of the index outside of the
      `index_insert` call fixes the issue.
      Russell Belfer committed
    • Attribute file cache refactor · 7d490872
      This is a big refactoring of the attribute file cache to be a bit
      simpler which in turn makes it easier to enforce a lock around any
      updates to the cache so that it can be used in a threaded env.
      Tons of changes to the attributes and ignores code.
      Russell Belfer committed
    • Fix leak in git_index_conflict_cleanup · aba6b5ed
      I introduced a leak into conflict cleanup by removing items from
      inside the git_vector_remove_matching call.  This simplifies the
      code to just use one common way for the two conflict cleanup APIs.
      
      When an index has an active snapshot, removing an item can cause
      an error (inserting into the deferred deletion vector), so I made
      the git_index_conflict_cleanup API return an error code.  I felt
      like this wasn't so bad since it is just like the other APIs.
      
      I fixed up a couple of comments while I was changing the header.
      Russell Belfer committed
    • Clean up index snapshot function naming · 52bb0476
      Clear up some of the various "find" functions and the snapshot
      API naming to be things I like more.
      Russell Belfer committed
    • Index locking and entry allocation changes · 8a2834d3
      This makes the lock management on the index a little bit broader,
      having a number of routines hold the lock across looking up the
      item to be modified and actually making the modification.  Still
      not true thread safety, but more pure index modifications are now
      safe which allows the simple cases (such as starting up a diff
      while index modifications are underway) safe enough to get the
      snapshot without hitting allocation problems.
      
      As part of this, I simplified the allocation of index entries to
      use a flex array and just put the path at the end of the index
      entry.  This makes every entry self-contained and makes it a
      little easier to feel sure that pointers to strings aren't
      being accidentally copied and freed while other references are
      still being held.
      Russell Belfer committed
    • Decouple index iterator sort from index · 3b4c401a
      This makes the index iterator honor the GIT_ITERATOR_IGNORE_CASE
      and GIT_ITERATOR_DONT_IGNORE_CASE flags without modifying the
      index data itself.  To take advantage of this, I had to export a
      number of the internal index entry comparison functions.  I also
      wrote some new tests to exercise the capability.
      Russell Belfer committed
    • Add mutex around index entries changes · dac16048
      This surrounds any function that mutates the entries vector with
      a mutex so it can be safely snapshotted.
      Russell Belfer committed
    • Some index internals refactoring · 3dbee456
      Again, laying groundwork for some index iterator changes, this
      contains a bunch of code refactorings for index internals that
      should make it easier down the line to add locking around index
      modifications.  Also this removes the redundant prefix_position
      function and fixes some potential memory leaks.
      Russell Belfer committed
    • Some vector utility tweaks · c67fd4c9
      This is just laying some groundwork for internal index changes
      that I'm working on.
      Russell Belfer committed
  5. 03 Apr, 2014 1 commit
  6. 01 Apr, 2014 2 commits
    • More tests and fix submodule index refresh · 8f4e5275
      There was a little bug where the submodule cache thought that the
      index date was out of date even when it wasn't that was resulting
      in some extra scans of index data even when not needed.
      
      Mostly this commit adds a bunch of new tests including adding and
      removing submodules in the index and in the HEAD and seeing if we
      can automatically pick them up when refreshing.
      Russell Belfer committed
    • Make submodule refresh a bit smarter · db0e7878
      This makes submodule cache refresh actually look at the timestamps
      from the data sources for submodules and reload as needed if they
      have changed since the last refresh.
      Russell Belfer committed
  7. 20 Mar, 2014 1 commit
  8. 10 Mar, 2014 1 commit
  9. 24 Feb, 2014 1 commit
  10. 20 Feb, 2014 1 commit
    • Address PR comments · 72556cc6
      * Make GIT_INLINE an internal definition so it cannot be used in
        public headers
      * Fix language in CONTRIBUTING
      * Make index caps API use signed instead of unsigned values
      Russell Belfer committed
  11. 07 Feb, 2014 1 commit
  12. 04 Feb, 2014 2 commits
    • Fix typo setting sorted flag when reloading index · 43709ca8
      This fixes a typo I made for setting the sorted flag on the index
      after a reload.  That typo didn't actually cause any test failures
      so I'm also adding a test that explicitly checks that the index is
      correctly sorted after a reload when ignoring case and when not.
      Russell Belfer committed
    • Convert pqueue to just be a git_vector · 882c7742
      This updates the git_pqueue to simply be a set of specialized
      init/insert/pop functions on a git_vector.
      
      To preserve the pqueue feature of having a fixed size heap, I
      converted the "sorted" field in git_vectors to a more general
      "flags" field so that pqueue could mix in it's own flag.  This
      had a bunch of ramifications because a number of places were
      directly looking at the vector "sorted" field - I added a couple
      new git_vector helpers (is_sorted, set_sorted) so the specific
      representation of this information could be abstracted.
      Russell Belfer committed
  13. 30 Jan, 2014 1 commit
  14. 29 Jan, 2014 3 commits
  15. 25 Jan, 2014 1 commit
  16. 11 Dec, 2013 3 commits
    • Remove converting user error to GIT_EUSER · 25e0b157
      This changes the behavior of callbacks so that the callback error
      code is not converted into GIT_EUSER and instead we propagate the
      return value through to the caller.  Instead of using the
      giterr_capture and giterr_restore functions, we now rely on all
      functions to pass back the return value from a callback.
      
      To avoid having a return value with no error message, the user
      can call the public giterr_set_str or some such function to set
      an error message.  There is a new helper 'giterr_set_callback'
      that functions can invoke after making a callback which ensures
      that some error message was set in case the callback did not set
      one.
      
      In places where the sign of the callback return value is
      meaningful (e.g. positive to skip, negative to abort), only the
      negative values are returned back to the caller, obviously, since
      the other values allow for continuing the loop.
      
      The hardest parts of this were in the checkout code where positive
      return values were overloaded as meaningful values for checkout.
      I fixed this by adding an output parameter to many of the internal
      checkout functions and removing the overload.  This added some
      code, but it is probably a better implementation.
      
      There is some funkiness in the network code where user provided
      callbacks could be returning a positive or a negative value and
      we want to rely on that to cancel the loop.  There are still a
      couple places where an user error might get turned into GIT_EUSER
      there, I think, though none exercised by the tests.
      Russell Belfer committed
    • Further EUSER and error propagation fixes · dab89f9b
      This continues auditing all the places where GIT_EUSER is being
      returned and making sure to clear any existing error using the
      new giterr_user_cancel helper.  As a result, places that relied
      on intercepting GIT_EUSER but having the old error preserved also
      needed to be cleaned up to correctly stash and then retrieve the
      actual error.
      
      Additionally, as I encountered places where error codes were not
      being propagated correctly, I tried to fix them up.  A number of
      those fixes are included in the this commit as well.
      Russell Belfer committed
  17. 19 Nov, 2013 1 commit
  18. 05 Nov, 2013 1 commit
  19. 01 Nov, 2013 2 commits
    • Convert git_index_read to have a "force" flag · 8e5a8ef8
      This is a little more intuitive than the turned-around option that
      I originally wrote.
      Russell Belfer committed
    • Make diff and status perform soft index reload · 4bf630b6
      This changes `git_index_read` to have two modes - a hard index
      reload that always resets the index to match the on-disk data
      (which was the old behavior) and a soft index reload that uses
      the timestamp / file size information and only replaces the index
      data if the file on disk has been modified.
      
      This then updates the git_status code to do a soft reload unless
      the new GIT_STATUS_OPT_NO_REFRESH flag is passed in.
      
      This also changes the behavior of the git_diff functions that use
      the index so that when an index is not explicitly passed in (i.e.
      when the functions call git_repository_index for you), they will
      also do a soft reload for you.
      
      This intentionally breaks the file signature of git_index_read
      because there has been some confusion about the behavior previously
      and it seems like all existing uses of the API should probably be
      examined to select the desired behavior.
      Russell Belfer committed
  20. 08 Oct, 2013 1 commit
    • More filemode cleanups for FAT on MacOS · 14997dc5
      This cleans up some additional issues.  The main change is that
      on a filesystem that doesn't support mode bits, libgit2 will now
      create new blobs with GIT_FILEMODE_BLOB always instead of being
      at the mercy to the filesystem driver to report executable or not.
      This means that if "core.filemode" lies and claims that filemode
      is not supported, then we will ignore the executable bit from the
      filesystem.  Previously we would have allowed it.
      
      This adds an option to the new git_repository_reset_filesystem to
      recurse through submodules if desired.  There may be other types
      of APIs that would like a "recurse submodules" option, but this
      one is particularly useful.
      
      This also has a number of cleanups, etc., for related things
      including trying to give better error messages when problems come
      up from the filesystem.  For example, the FAT filesystem driver on
      MacOS appears to return errno EINVAL if you attempt to write a
      filename with invalid UTF-8 in it.  We try to capture that with a
      better error message now.
      Russell Belfer committed
  21. 04 Oct, 2013 1 commit
  22. 24 Sep, 2013 1 commit
    • Clean up newly introduced warnings · 1ca3e49f
      The attempt to "clean up warnings" seems to have introduced some
      new warnings on compliant compilers.  This fixes those in a way
      that I suspect will also be okay for the non-compliant compilers.
      
      Also this fixes what appears to be an extra semicolon in the
      repo initialization template dir handling (and as part of that
      fix, handles the case where an error occurs correctly).
      Russell Belfer committed
  23. 19 Sep, 2013 1 commit
  24. 05 Sep, 2013 1 commit