1. 18 Apr, 2013 1 commit
  2. 07 Mar, 2013 3 commits
    • Add INCLUDE_TREES, DONT_AUTOEXPAND iterator flags · 9bea03ce
      This standardizes iterator behavior across all three iterators
      (index, tree, and working directory).  Previously the working
      directory iterator behaved differently from the other two.
      
      Each iterator can now operate in one of three modes:
      
      1. *No tree results, auto expand trees* means that only non-
         tree items will be returned and when a tree/directory is
         encountered, we will automatically descend into it.
      2. *Tree results, auto expand trees* means that results will
         be given for every item found, including trees, but you
         only need to call normal git_iterator_advance to yield
         every item (i.e. trees returned with pre-order iteration).
      3. *Tree results, no auto expand* means that calling the
         normal git_iterator_advance when looking at a tree will
         not descend into the tree, but will skip over it to the
         next entry in the parent.
      
      Previously, behavior 1 was the only option for index and tree
      iterators, and behavior 3 was the only option for workdir.
      
      The main public API implications of this are that the
      `git_iterator_advance_into()` call is now valid for all
      iterators, not just working directory iterators, and all the
      existing uses of working directory iterators explicitly use
      the GIT_ITERATOR_DONT_AUTOEXPAND (for now).
      
      Interestingly, the majority of the implementation was in the
      index iterator, since there are no tree entries there and now
      have to fake them.  The tree and working directory iterators
      only required small modifications.
      Russell Belfer committed
    • Retire spoolandsort iterator · cc216a01
      Since the case sensitivity is moved into the respective iterators,
      this removes the spoolandsort iterator code.
      Russell Belfer committed
    • 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
  3. 15 Jan, 2013 3 commits
    • Support case insensitive tree iterators and status · 25423d03
      This makes tree iterators directly support case insensitivity by
      using a secondary index that can be sorted by icase.  Also, this
      fixes the ambiguity check in the git_status_file API to also be
      case insensitive.  Lastly, this adds new test cases for case
      insensitive range boundary checking for all types of iterators.
      
      With this change, it should be possible to deprecate the spool
      and sort iterator, but I haven't done that yet.
      Russell Belfer committed
    • Update iterator API with flags for ignore_case · 134d8c91
      This changes the iterator API so that flags can be passed in to
      the constructor functions to control the ignore_case behavior.
      At this point, the flags are not supported on tree iterators (i.e.
      there is no functional change over the old API), but the API
      changes are all made to accomodate this.
      
      By the way, I went with a flags parameter because in the future
      I have a couple of other ideas for iterator flags that will make
      it easier to fix some diff/status/checkout bugs.
      Russell Belfer committed
    • 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
  4. 08 Jan, 2013 1 commit
  5. 04 Jan, 2013 2 commits
    • Fix up spoolandsort iterator usage · 546d65a8
      The spoolandsort iterator changes got sort-of cherry picked out of
      this branch and so I dropped the commit when rebasing; however,
      there were a few small changes that got dropped as well (since the
      version merged upstream wasn't quite the same as what I dropped).
      Russell Belfer committed
    • Add index updating to checkout · 5cf9875a
      Make checkout update entries in the index for all files that are
      updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX
      is given.  To do this, iterators were extended to allow a little
      more introspection into the index being iterated over, etc.
      Russell Belfer committed
  6. 28 Dec, 2012 1 commit
    • Make spoolandsort a pushable iterator behavior · f616a36b
      An earlier change to `git_diff_from_iterators` introduced a
      memory leak where the allocated spoolandsort iterator was not
      returned to the caller and thus not freed.
      
      One proposal changes all iterator APIs to use git_iterator** so
      we can reallocate the iterator at will, but that seems unexpected.
      This commit makes it so that an iterator can be changed in place.
      The callbacks are isolated in a separate structure and a pointer
      to that structure can be reassigned by the spoolandsort extension.
      
      This means that spoolandsort doesn't create a new iterator; it
      just allocates a new block of callbacks (along with space for its
      own extra data) and swaps that into the iterator.
      
      Additionally, since spoolandsort is only needed to switch the
      case sensitivity of an iterator, this simplifies the API to only
      take the ignore_case boolean and to be a no-op if the iterator
      already matches the requested case sensitivity.
      Russell Belfer committed
  7. 10 Dec, 2012 2 commits
    • Fix iterator reset and add reset ranges · 91e7d263
      The `git_iterator_reset` command has not been working in all cases
      particularly when there is a start and end range.  This fixes it
      and adds tests for it, and also extends it with the ability to
      update the start/end range strings when an iterator is reset.
      Russell Belfer committed
    • 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
  8. 15 Nov, 2012 1 commit
  9. 09 Oct, 2012 1 commit
    • Add complex checkout test and then fix checkout · 0d64bef9
      This started as a complex new test for checkout going through the
      "typechanges" test repository, but that revealed numerous issues
      with checkout, including:
      
      * complete failure with submodules
      * failure to create blobs with exec bits
      * problems when replacing a tree with a blob because the tree
        "example/" sorts after the blob "example" so the delete was
        being processed after the single file blob was created
      
      This fixes most of those problems and includes a number of other
      minor changes that made it easier to do that, including improving
      the TYPECHANGE support in diff/status, etc.
      Russell Belfer committed
  10. 08 Oct, 2012 1 commit
    • Fix a few diff bugs with directory content · dfbff793
      There are a few cases where diff should leave directories in
      the diff list if we want to match core git, such as when the
      directory contains a .git dir.  That feature was lost when I
      introduced some of the new submodule handling.
      
      This restores that and then fixes a couple of related to diff
      output that are triggered by having diffs with directories in
      them.
      
      Also, this adds a new flag that can be passed to diff if you
      want diff output to actually include the file content of any
      untracked files.
      Russell Belfer committed
  11. 17 Sep, 2012 2 commits
  12. 15 May, 2012 1 commit
    • Ranged iterators and rewritten git_status_file · 41a82592
      The goal of this work is to rewrite git_status_file to use the
      same underlying code as git_status_foreach.
      
      This is done in 3 phases:
      
      1. Extend iterators to allow ranged iteration with start and
         end prefixes for the range of file names to be covered.
      2. Improve diff so that when there is a pathspec and there is
         a common non-wildcard prefix of the pathspec, it will use
         ranged iterators to minimize excess iteration.
      3. Rewrite git_status_file to call git_status_foreach_ext
         with a pathspec that covers just the one file being checked.
      
      Since ranged iterators underlie the status & diff implementation,
      this is actually fairly efficient.  The workdir iterator does
      end up loading the contents of all the directories down to the
      single file, which should ideally be avoided, but it is pretty
      good.
      Russell Belfer committed
  13. 13 May, 2012 1 commit
  14. 08 May, 2012 1 commit
  15. 02 Mar, 2012 1 commit
    • 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
  16. 22 Feb, 2012 1 commit
    • Iterator improvements from diff implementation · da337c80
      This makes two changes to iterator behavior: first, advance
      can optionally do the work of returning the new current value.
      This is such a common pattern that it really cleans up usage.
      
      Second, for workdir iterators, this removes automatically
      iterating into directories.  That seemed like a good idea,
      but when an entirely new directory hierarchy is introduced
      into the workdir, there is no reason to iterate into it if
      there are no corresponding entries in the tree/index that it
      is being compared to.
      
      This second change actually wasn't a lot of code because not
      descending into directories was already the behavior for
      ignored directories.  This just extends that to all directories.
      Russell Belfer committed
  17. 21 Feb, 2012 1 commit
    • Uniform iterators for trees, index, and workdir · b6c93aef
      This create a new git_iterator type of object that provides a
      uniform interface for iterating over the index, an arbitrary
      tree, or the working directory of a repository.
      
      As part of this, git ignore support was extended to support
      push and pop of directory-based ignore files as the working
      directory is being traversed (so the array of ignores does
      not have to be recreated at each directory during traveral).
      
      There are a number of other small utility functions in buffer,
      path, vector, and fileops that are included in this patch
      that made the iterator implementation cleaner.
      Russell Belfer committed