1. 08 Jan, 2013 1 commit
  2. 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
  3. 01 Dec, 2012 1 commit
  4. 30 Nov, 2012 2 commits
  5. 27 Nov, 2012 2 commits
  6. 22 Nov, 2012 1 commit
  7. 15 Nov, 2012 2 commits
  8. 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
  9. 01 Nov, 2012 1 commit
  10. 15 Oct, 2012 1 commit
    • Fix single-file ignore checks · 52032ae5
      To answer if a single given file should be ignored, the path to
      that file has to be processed progressively checking that there
      are no intermediate ignored directories in getting to the file
      in question.  This enables that, fixing the broken old behavior,
      and adds tests to exercise various ignore situations.
      Russell Belfer committed
  11. 09 Oct, 2012 2 commits
    • 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
    • Introduce status/diff TYPECHANGE flags · bc16fd3e
      When I wrote the diff code, I based it on core git's diff output
      which tends to split a type change into an add and a delete.  But
      core git's status has the notion of a T (typechange) flag for a
      file.  This introduces that into our status APIs and modifies the
      diff code so it can be forced to not split type changes.
      Russell Belfer committed
  12. 17 Sep, 2012 1 commit
  13. 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
  14. 22 Aug, 2012 1 commit
  15. 04 Aug, 2012 1 commit
    • Update iterators for consistency across library · 5dca2010
      This updates all the `foreach()` type functions across the library
      that take callbacks from the user to have a consistent behavior.
      The rules are:
      
      * A callback terminates the loop by returning any non-zero value
      * Once the callback returns non-zero, it will not be called again
        (i.e. the loop stops all iteration regardless of state)
      * If the callback returns non-zero, the parent fn returns GIT_EUSER
      * Although the parent returns GIT_EUSER, no error will be set in
        the library and `giterr_last()` will return NULL if called.
      
      This commit makes those changes across the library and adds tests
      for most of the iteration APIs to make sure that they follow the
      above rules.
      Russell Belfer committed
  16. 24 Jul, 2012 3 commits
  17. 17 May, 2012 2 commits
  18. 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
  19. 10 May, 2012 1 commit
    • Add cache busting to attribute cache · dc13f1f7
      This makes the git attributes and git ignores cache check
      stat information before using the file contents from the
      cache.  For cached files from the index, it checks the SHA
      of the file instead.  This should reduce the need to ever
      call `git_attr_cache_flush()` in most situations.
      
      This commit also fixes the `git_status_should_ignore` API
      to use the libgit2 standard parameter ordering.
      Russell Belfer committed
  20. 08 May, 2012 2 commits
  21. 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
  22. 02 May, 2012 1 commit
  23. 23 Apr, 2012 1 commit
  24. 17 Apr, 2012 2 commits
    • Add git_reference_lookup_oid and lookup_resolved · f201d613
      Adds a new public reference function `git_reference_lookup_oid`
      that directly resolved a reference name to an OID without returning
      the intermediate `git_reference` object (hence, no free needed).
      
      Internally, this adds a `git_reference_lookup_resolved` function
      that combines looking up and resolving a reference.  This allows
      us to be more efficient with memory reallocation.
      
      The existing `git_reference_lookup` and `git_reference_resolve`
      are reimplmented on top of the new utility and a few places in the
      code are changed to use one of the two new functions.
      Russell Belfer committed
    • Remove old status implementation · dbeca796
      This removes the code for the old status implementation.
      Russell Belfer committed
  25. 13 Apr, 2012 1 commit
  26. 11 Apr, 2012 1 commit
  27. 04 Apr, 2012 1 commit
  28. 26 Mar, 2012 1 commit
    • Eliminate hairy COITERATE macro · 1db12b00
      I decided that the COITERATE macro was, in the end causing
      more confusion that it would save and decided just to write
      out the loops that I needed for parallel diff list iteration.
      It is not that much code and this just feels less obfuscated.
      Russell Belfer committed
  29. 23 Mar, 2012 2 commits
    • Restore default status recursion behavior · c8838ee9
      This gives `git_status_foreach()` back its old behavior of
      emulating the "--untracked=all" behavior of git.  You can
      get any of the various --untracked options by passing flags
      to `git_status_foreach_ext()` but the basic version will
      keep the behavior it has always had.
      Russell Belfer committed
    • Fix crash in new status and add recurse option · 4b136a94
      This fixes the bug that @nulltoken found (thank you!) where
      if there were untracked directories alphabetically after the
      last tracked item, the diff implementation would deref a NULL
      pointer.
      
      The fix involved the code which decides if it is necessary
      to recurse into a directory in the working dir, so it was
      easy to add a new option `GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS`
      to control if the contents of untracked directories should be
      included in status.
      Russell Belfer committed
  30. 22 Mar, 2012 1 commit
    • New status fixes · 66142ae0
      This adds support for roughly-right tracking of submodules
      (although it does not recurse into submodules to detect
      internal modifications a la core git), and it adds support
      for including unmodified files in diff iteration if requested.
      Russell Belfer committed