1. 10 Jul, 2013 4 commits
    • Add ignore_submodules to diff options · f9775a37
      This adds correct support for an equivalent to --ignore-submodules
      in diff, where an actual ignore value can be passed to diff to
      override the per submodule settings in the configuration.
      
      This required tweaking the constants for ignore values so that
      zero would not be used and could represent an unset option to the
      diff.  This was an opportunity to move the submodule values into
      include/git2/types.h and to rename the poorly named DEFAULT values
      for ignore and update constants to RESET instead.
      
      Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as
      setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL
      (which is actually a minor change from the old behavior in that
      submodules will now be treated as UNMODIFIED deltas instead of
      being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED).
      
      This includes tests for the various new settings.
      Russell Belfer committed
    • Submodule status improvements · 1aad6137
      This fixes the way that submodule status is checked to bypass just
      about all of the caching in the submodule object.  Based on the
      ignore value, it will try to do the minimum work necessary to find
      the current status of the submodule - but it will actually go to
      disk to get all of the current values.
      
      This also removes the custom refcounting stuff in favor of the
      common git_refcount style.  Right now, it is still for internal
      purposes only, but it should make it easier to add true submodule
      refcounting in the future with a public git_submodule_free call
      that will allow bindings not to worry about the submodule object
      getting freed from underneath them.
      Russell Belfer committed
    • Add timestamp check to submodule status · e807860f
      This is probably not the final form of this change, but this is
      a preliminary version of checking a timestamp to see if the cached
      working directory HEAD OID matches the current.  Right now, this
      uses the timestamp on the index and is, like most of our timestamp
      checking, subject to having only second accuracy.
      Russell Belfer committed
  2. 28 Jun, 2013 1 commit
  3. 20 Jun, 2013 1 commit
    • Add status flags to force output sort order · 22b6b82f
      Files in status will, be default, be sorted according to the case
      insensitivity of the filesystem that we're running on.  However,
      in some cases, this is not desirable.  Even on case insensitive
      file systems, 'git status' at the command line will generally use
      a case sensitive sort (like 'ls').  Some GUIs prefer to display a
      list of file case insensitively even on case-sensitive platforms.
      
      This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY
      and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the
      default sort order of the status output and give the user control.
      This includes tests for exercising these new options and makes
      the examples/status.c program emulate core Git and always use a
      case sensitive sort.
      Russell Belfer committed
  4. 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
  5. 31 May, 2013 1 commit
    • Make iterators use GIT_ITEROVER & smart advance · cee695ae
      1. internal iterators now return GIT_ITEROVER when you go past the
         last item in the iteration.
      2. git_iterator_advance will "advance" to the first item in the
         iteration if it is called immediately after creating the
         iterator, which allows a simpler idiom for basic iteration.
      3. if git_iterator_advance encounters an error reading data (e.g.
         a missing tree or an unreadable file), it returns the error
         but also attempts to advance past the invalid data to prevent
         an infinite loop.
      
      Updated all tests and internal usage of iterators to account for
      these new behaviors.
      Russell Belfer committed
  6. 01 May, 2013 1 commit
  7. 21 Apr, 2013 1 commit
  8. 30 Mar, 2013 1 commit
  9. 26 Mar, 2013 1 commit
    • Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULES · 37ee70fa
      This option has been sitting unimplemented for a while, so I
      finally went through and implemented it along with some tests.
      
      As part of this, I improved the implementation of
      GIT_DIFF_IGNORE_SUBMODULES so it be more diligent about avoiding
      extra work and about leaving off delta records for submodules to
      the greatest extent possible (though it may include them still
      if you are request TYPECHANGE records).
      Russell Belfer committed
  10. 17 Mar, 2013 1 commit
  11. 07 Mar, 2013 1 commit
    • Make iterator APIs consistent with standards · 169dc616
      The iterator APIs are not currently consistent with the parameter
      ordering of the rest of the codebase.  This rearranges the order
      of parameters, simplifies the naming of a number of functions, and
      makes somewhat better use of macros internally to clean up the
      iterator code.
      
      This also expands the test coverage of iterator functionality,
      making sure that case sensitive range-limited iteration works
      correctly.
      Russell Belfer committed
  12. 27 Jan, 2013 1 commit
  13. 15 Jan, 2013 1 commit
    • Minor iterator API cleanups · 4b181037
      In preparation for further iterator changes, this cleans up a few
      small things in the iterator API:
      
      * removed the git_iterator_for_repo_index_range API
      * made git_iterator_free not be inlined
      * minor param name and test function name tweaks
      Russell Belfer committed
  14. 12 Jan, 2013 1 commit
  15. 08 Jan, 2013 1 commit
  16. 04 Jan, 2013 1 commit
    • Submodule caching fix and location API · a9a73007
      This adds a new API to the submodule interface that just returns
      where information about the submodule was found (e.g. config file
      only or in the HEAD, index, or working directory).
      
      Also, the old "refresh" call was potentially keeping some stale
      submodule data around, so this simplfies that code and literally
      discards the old cache, then reallocates.
      Russell Belfer committed
  17. 17 Dec, 2012 1 commit
    • Fix diff constructor name order confusion · 56c72b75
      The diff constructor functions had some confusing names, where the
      "old" side of the diff was coming after the "new" side.  This
      reverses the order in the function name to make it less confusing.
      
      Specifically...
      
      * git_diff_index_to_tree becomes git_diff_tree_to_index
      * git_diff_workdir_to_index becomes git_diff_index_to_workdir
      * git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
      Russell Belfer committed
  18. 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
  19. 30 Nov, 2012 2 commits
  20. 28 Nov, 2012 2 commits
    • Consolidate text buffer functions · 7bf87ab6
      There are many scattered functions that look into the contents of
      buffers to do various text manipulations (such as escaping or
      unescaping data, calculating text stats, guessing if content is
      binary, etc).  This groups all those functions together into a
      new file and converts the code to use that.
      
      This has two enhancements to existing functionality.  The old
      text stats function is significantly rewritten and the BOM
      detection code was extended (although largely we can't deal with
      anything other than a UTF8 BOM).
      Russell Belfer committed
    • Fix uninitialized variable · 7cdad6c7
      clang-SVN HEAD kindly provided my the info, that sm_repo maybe
      uninitialized when we want to free it (If the expression in line 358 or
      359/360 evaluate to true, we jump to "cleanup", where we'd use sm_repo
      uninitialized).
      Sascha Cunz committed
  21. 27 Nov, 2012 4 commits
  22. 15 Nov, 2012 3 commits
  23. 09 Nov, 2012 1 commit
    • 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
  24. 30 Oct, 2012 1 commit
  25. 23 Oct, 2012 1 commit
    • Add config level support in the config API · a1abe66a
      Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found.
      Added `git_config_open_level`: build a single-level focused config object from a multi-level one.
      
      We are now storing `git_config_entry`s in the khash of the config_file
      yorah committed
  26. 07 Oct, 2012 1 commit
  27. 28 Sep, 2012 1 commit
  28. 25 Sep, 2012 1 commit
    • 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
  29. 07 Sep, 2012 1 commit
  30. 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