1. 01 May, 2015 1 commit
  2. 04 Mar, 2015 1 commit
  3. 03 Mar, 2015 2 commits
  4. 14 Jan, 2015 1 commit
  5. 23 Nov, 2014 1 commit
  6. 07 Nov, 2014 1 commit
    • iterator: submodules are determined by an index or tree · 62a617dc
      We cannot know from looking at .gitmodules whether a directory is a
      submodule or not. We need the index or tree we are comparing against to
      tell us. Otherwise we have to assume the entry in .gitmodules is stale
      or otherwise invalid.
      
      Thus we pass the index of the repository into the workdir iterator, even
      if we do not want to compare against it. This follows what git does,
      which even for `git diff <tree>`, it will consider staged submodules as
      such.
      Carlos Martín Nieto committed
  7. 01 Jul, 2014 1 commit
  8. 27 May, 2014 1 commit
  9. 16 May, 2014 1 commit
  10. 12 May, 2014 1 commit
  11. 06 May, 2014 1 commit
    • Improve checks for ignore containment · f554611a
      The diff code was using an "ignored_prefix" directory to track if
      a parent directory was ignored that contained untracked files
      alongside tracked files. Unfortunately, when negative ignore rules
      were used for directories inside ignored parents, the wrong rules
      were applied to untracked files inside the negatively ignored
      child directories.
      
      This commit moves the logic for ignore containment into the workdir
      iterator (which is a better place for it), so the ignored-ness of
      a directory is contained in the frame stack during traversal.  This
      allows a child directory to override with a negative ignore and yet
      still restore the ignored state of the parent when we traverse out
      of the child.
      
      Along with this, there are some problems with "directory only"
      ignore rules on container directories.  Given "a/*" and "!a/b/c/"
      (where the second rule is a directory rule but the first rule is
      just a generic prefix rule), then the directory only constraint
      was having "a/b/c/d/file" match the first rule and not the second.
      This was fixed by having ignore directory-only rules test a rule
      against the prefix of a file with LEADINGDIR enabled.
      
      Lastly, spot checks for ignores using `git_ignore_path_is_ignored`
      were tested from the top directory down to the bottom to deal with
      the containment problem, but this is wrong. We have to test bottom
      to top so that negative subdirectory rules will be checked before
      parent ignore rules.
      
      This does change the behavior of some existing tests, but it seems
      only to bring us more in line with core Git, so I think those
      changes are acceptable.
      Russell Belfer committed
  12. 02 May, 2014 8 commits
  13. 23 Apr, 2014 1 commit
  14. 22 Apr, 2014 1 commit
    • Use git_diff_get_stats in example/diff + refactor · 8d09efa2
      This takes the `--stat` and related example options in the example
      diff.c program and converts them to use the `git_diff_get_stats`
      API which nicely formats stats for you.
      
      I went to add bar-graph scaling to the stats formatter and noticed
      that the `git_diff_stats` structure was holding on to all of the
      `git_patch` objects.  Unfortunately, each of these objects keeps
      the full text of the diff in memory, so this is very expensive.  I
      ended up modifying `git_diff_stats` to keep just the data that it
      needs to keep and allowed it to release the patches.  Then, I added
      width scaling to the output on top of that.
      
      In making the diff example program match 'git diff' output, I ended
      up removing an newline from the sumamry output which I then had to
      compensate for in the email formatting to match the expectations.
      
      Lastly, I went through and refactored the tests to use a couple of
      helper functions and reduce the overall amount of code there.
      Russell Belfer committed
  15. 17 Apr, 2014 3 commits
    • 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 public diff print helpers · 27e54bcf
      The usefulness of these helpers came up for me while debugging
      some of the iterator changes that I was making, so since they
      have also been requested (albeit indirectly) I thought I'd include
      them.
      Russell Belfer committed
  16. 15 Apr, 2014 4 commits
  17. 01 Apr, 2014 1 commit
    • Remove most submodule reloads from tests · 8061d519
      With the new submodule cache validity checks, we generally don't
      need to call git_submodule_reload_all to have up-to-date submodule
      data.  Some tests are still calling it where I want to actually
      test that it can be called safely and doesn't break anything, but
      mostly it is not needed.
      
      This also expands some of the existing submodule tests to cover
      some variants on the behavior that was already being tested.
      Russell Belfer committed
  18. 31 Mar, 2014 1 commit
  19. 27 Mar, 2014 1 commit
  20. 25 Mar, 2014 2 commits
    • Update behavior for untracked sub-repos · d3bc95fd
      When a directory containing a .git directory (or even just a plain
      gitlink) was found, libgit2 was going out of its way to treat it
      specially.  This seemed like it was necessary because the diff
      code was not originally emulating Git's behavior for untracked
      directories correctly (i.e. scanning for ignored vs untracked items
      inside).  Now that libgit2 diff mimics Git's untracked directory
      behavior, the special handling for contained Git repos is actually
      incorrect and this commit rips it out.
      Russell Belfer committed
    • Make submodules externally refcounted · a15c7802
      `git_submodule` objects were already refcounted internally in case
      the submodule name was different from the path at which it was
      stored.  This makes that refcounting externally used as well, so
      `git_submodule_lookup` and `git_submodule_add_setup` return an
      object that requires a `git_submodule_free` when done.
      Russell Belfer committed
  21. 06 Mar, 2014 1 commit
  22. 27 Feb, 2014 1 commit
    • Add buffer to buffer diff and patch APIs · 6789b7a7
      This adds `git_diff_buffers` and `git_patch_from_buffers`.  This
      also includes a bunch of internal refactoring to increase the
      shared code between these functions and the blob-to-blob and
      blob-to-buffer APIs, as well as some higher level assert helpers
      in the tests to also remove redundancy.
      Russell Belfer committed
  23. 27 Jan, 2014 1 commit
    • Update Javascript userdiff driver and tests · 082e82db
      Writing a sample Javascript driver pointed out some extra
      whitespace handling that needed to be done in the diff driver.
      This adds some tests with some sample javascript code that I
      pulled off of GitHub just to see what would happen.  Also, to
      clean up the userdiff test data, I did a "git gc" and packed
      up the test objects.
      Russell Belfer committed
  24. 25 Jan, 2014 2 commits
  25. 24 Jan, 2014 1 commit