1. 23 Apr, 2014 1 commit
  2. 22 Jan, 2014 1 commit
    • Drop git_patch_to_str · c05cd792
      It's hard or even impossible to correctly free the string buffer
      allocated by git_patch_to_str in some circumstances. Drop the function
      so people have to use git_patch_to_buf instead - git_buf has a dedicated
      destructor.
      Nicolas Hake committed
  3. 12 Dec, 2013 1 commit
  4. 18 Nov, 2013 1 commit
  5. 14 Nov, 2013 1 commit
  6. 21 Oct, 2013 1 commit
    • Create git_diff_line and extend git_diff_hunk · 3b5f7954
      Instead of having functions with so very many parameters to pass
      hunk and line data, this takes the existing git_diff_hunk struct
      and extends it with more hunk data, plus adds a git_diff_line.
      Those structs are used to pass back hunk and line data instead of
      the old APIs that took tons of parameters.
      
      Some work that was previously only being done for git_diff_patch
      creation (scanning the diff content for exact line counts) is now
      done for all callbacks, but the performance difference should not
      be noticable.
      Russell Belfer committed
  7. 15 Oct, 2013 1 commit
    • Diff API cleanup · 10672e3e
      This lays groundwork for separating formatting options from diff
      creation options.  This groups the formatting flags separately
      from the diff list creation flags and reorders the options.  This
      also tweaks some APIs to further separate code that uses patches
      from code that just looks at git_diffs.
      Russell Belfer committed
  8. 11 Oct, 2013 1 commit
  9. 08 Oct, 2013 2 commits
    • 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
  10. 04 Oct, 2013 1 commit
    • Add git_repository_reset_filesystem and fix tests · 5173ea92
      When a repository is transferred from one file system to another,
      many of the config settings that represent the properties of the
      file system may be wrong.  This adds a new public API that will
      refresh the config settings of the repository to account for the
      change of file system.  This doesn't do a full "reinitialize" and
      operates on a existing git_repository object refreshing the config
      when done.
      
      This commit then makes use of the new API in clar as each test
      repository is set up.
      
      This commit also has a number of other clar test fixes where we
      were making assumptions about the type of filesystem, either based
      on outdated config data or based on the OS instead of the FS.
      Russell Belfer committed
  11. 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
  12. 22 Jul, 2013 1 commit
  13. 11 Jun, 2013 1 commit
    • Implement regex pattern diff driver · 5dc98298
      This implements the loading of regular expression pattern lists
      for diff drivers that search for function context in that way.
      This also changes the way that diff drivers update options and
      interface with xdiff APIs to make them a little more flexible.
      Russell Belfer committed
  14. 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
  15. 07 May, 2013 3 commits
    • Fix line numbering for patches with eofnl · c2f602f8
      When a patch contained an eofnl change (i.e. the last line either
      gained or lost a newline), the oldno and newno line number values
      for the lines in the last hunk of the patch were not useful.  This
      makes them behave in a more expected manner.
      Russell Belfer committed
    • 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
  16. 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
  17. 21 Apr, 2013 1 commit
  18. 03 Mar, 2013 1 commit
    • Fix a few leaks · 323bb885
      `git_diff_get_patch()` would unconditionally load the patch object and
      then simply leak it if the user hadn't requested it. Short-circuit
      loading the object if the user doesn't want it.
      
      The rest of the plugs are simply calling the free functions of objects
      allocated during the tests.
      Carlos Martín Nieto committed
  19. 01 Mar, 2013 2 commits
  20. 22 Feb, 2013 1 commit
    • Fix tests for find_similar and related · 6f9d5ce8
      This fixes both a test that I broke in diff::patch where I was
      relying on the current state of the working directory for the
      renames test data and fixes an unstable test in diff::rename
      where the environment setting for the "diff.renames" config was
      being allowed to influence the test results.
      Russell Belfer committed
  21. 05 Feb, 2013 1 commit
  22. 30 Jan, 2013 2 commits
    • Add helper for diff line stats · f1e2735c
      This adds a `git_diff_patch_line_stats()` API that gets the total
      number of adds, deletes, and context lines in a patch.  This will
      make it a little easier to emulate `git diff --stat` and the like.
      
      Right now, this relies on generating the `git_diff_patch` object,
      which is a pretty heavyweight way to get stat information.  At
      some future point, it would probably be nice to be able to get
      this information without allocating the entire `git_diff_patch`,
      but that's a much larger project.
      Russell Belfer committed
  23. 11 Jan, 2013 1 commit
    • Fix diff patch line number calculation · 805c476c
      This was just wrong.  Added a test that verifying patch line
      numbers even for hunks further into a file and then fixed the
      algorithm.  I needed to add a little extra state into the patch
      so that I could track old and new file numbers independently,
      but it should be okay.
      Russell Belfer committed
  24. 27 Nov, 2012 2 commits
  25. 15 Nov, 2012 1 commit
  26. 25 Oct, 2012 1 commit
  27. 25 Sep, 2012 1 commit
    • 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
  28. 02 May, 2012 1 commit
  29. 01 May, 2012 1 commit
  30. 30 Apr, 2012 1 commit
  31. 25 Apr, 2012 1 commit