1. 23 Apr, 2013 1 commit
    • Improve diff config options handling · b1ff7004
      This makes diff use the cvar cache for config options where
      possible, and also adds support for a number of other config
      options to diff including "diff.context", "diff.ignoreSubmodules",
      "diff.noprefix", "diff.mnemonicprefix", and "core.abbrev".
      
      To make this natural, this involved a rearrangement of the code
      that allocates the diff object vs. the code that initializes it
      based on the combination of options passed in by the user and
      read from the config.
      
      This commit includes tests for most of these new options as well.
      Russell Belfer committed
  2. 25 Mar, 2013 2 commits
  3. 09 Mar, 2013 1 commit
  4. 22 Feb, 2013 1 commit
  5. 06 Feb, 2013 2 commits
  6. 30 Nov, 2012 1 commit
  7. 27 Nov, 2012 2 commits
  8. 15 Nov, 2012 1 commit
  9. 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
  10. 08 Oct, 2012 1 commit
  11. 28 Sep, 2012 1 commit
  12. 25 Sep, 2012 2 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
    • 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
  13. 13 Sep, 2012 1 commit
  14. 05 Sep, 2012 1 commit
    • Diff iterators · f335ecd6
      This refactors the diff output code so that an iterator object
      can be used to traverse and generate the diffs, instead of just
      the `foreach()` style with callbacks.  The code has been rearranged
      so that the two styles can still share most functions.
      
      This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses
      that as a common error code for marking the end of iteration when
      using a iterator style of object.
      Russell Belfer committed
  15. 19 Jul, 2012 1 commit
  16. 08 Jun, 2012 1 commit
    • Minor fixes, cleanups, and clarifications · 145e696b
      There are three actual changes in this commit:
      
      1. When the trailing newline of a file is removed in a diff, the
         change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
         to the callback.  Previously, the `ADD_EOFNL` constant was given
         which was just an error in my understanding of when the various
         circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
         should never be generated.  A new newline is simply an `ADD`.
      2. Rewrote the `diff_delta__merge_like_cgit` function that contains
         the core logic of the `git_diff_merge` implementation.  The new
         version doesn't actually have significantly different behavior,
         but the logic should be much more obvious, I think.
      3. Fixed a bug in `git_diff_merge` where it freed a string pool
         while some of the string data was still in use.  This led to
         `git_diff_print_patch` accessing memory that had been freed.
      
      The rest of this commit contains improved documentation in `diff.h`
      to make the behavior and the equivalencies with core git clearer,
      and a bunch of new tests to cover the various cases, oh and a minor
      simplification of `examples/diff.c`.
      Russell Belfer committed
  17. 07 May, 2012 1 commit
  18. 04 May, 2012 1 commit
  19. 03 May, 2012 1 commit
    • Support reading attributes from index · f917481e
      Depending on the operation, we need to consider gitattributes
      in both the work dir and the index.  This adds a parameter to
      all of the gitattributes related functions that allows user
      control of attribute reading behavior (i.e. prefer workdir,
      prefer index, only use index).
      
      This fix also covers allowing us to check attributes (and
      hence do diff and status) on bare repositories.
      
      This was a somewhat larger change that I hoped because it had
      to change the cache key used for gitattributes files.
      Russell Belfer committed
  20. 17 Apr, 2012 1 commit
  21. 02 Mar, 2012 5 commits
    • Clean up GIT_UNUSED macros on all platforms · 854eccbb
      It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5
      did not fix the GIT_USUSED behavior on all platforms.  This commit
      walks through and really cleans things up more thoroughly, getting
      rid of the unnecessary stuff.
      
      To remove the use of some GIT_UNUSED, I ended up adding a couple
      of new iterators for hashtables that allow you to iterator just
      over keys or just over values.
      
      In making this change, I found a bug in the clar tests (where we
      were doing *count++ but meant to do (*count)++ to increment the
      value).  I fixed that but then found the test failing because it
      was not really using an empty repo.  So, I took some of the code
      that I wrote for iterator testing and moved it to clar_helpers.c,
      then made use of that to make it easier to open fixtures on a
      per test basis even within a single test file.
      Russell Belfer committed
    • Update diff to use iterators · 74fa4bfa
      This is a major reorganization of the diff code.  This changes
      the diff functions to use the iterators for traversing the
      content.  This allowed a lot of code to be simplified.  Also,
      this moved the functions relating to outputting a diff into a
      new file (diff_output.c).
      
      This includes a number of other changes - adding utility
      functions, extending iterators, etc. plus more tests for the
      diff code.  This also takes the example diff.c program much
      further in terms of emulating git-diff command line options.
      Russell Belfer committed
    • Add tests and fix bugs for diff whitespace options · caf71ec0
      Once I added tests for the whitespace handling options of
      diff, I realized that there were some bugs.  This fixes
      those and adds the new tests into the test suite.
      Russell Belfer committed
    • Continue implementation of git-diff · a2e895be
      * Implemented git_diff_index_to_tree
      * Reworked git_diff_options structure to handle more options
      * Made most of the options in git_diff_options actually work
      * Reorganized code a bit to remove some redundancy
      * Added option parsing to examples/diff.c to test most options
      Russell Belfer committed
    • Clean up diff implementation for review · 3a437590
      This fixes several bugs, updates tests and docs, eliminates the
      FILE* assumption in favor of printing callbacks for the diff patch
      formatter helpers, and adds a "diff" example function that can
      perform a diff from the command line.
      Russell Belfer committed