1. 10 Jul, 2013 5 commits
    • Add git_pathspec_match_diff API · 2b672d5b
      This adds an additional pathspec API that will match a pathspec
      against a diff object.  This is convenient if you want to handle
      renames (so you need the whole diff and can't use the pathspec
      constraint built into the diff API) but still want to tell if the
      diff had any files that matched the pathspec.
      
      When the pathspec is matched against a diff, instead of keeping
      a list of filenames that matched, instead the API keeps the list
      of git_diff_deltas that matched and they can be retrieved via a
      new API git_pathspec_match_list_diff_entry.
      
      There are a couple of other minor API extensions here that were
      mostly for the sake of convenience and to reduce dependencies
      on knowing the internal data structure between files inside the
      library.
      Russell Belfer committed
    • Fix example/log.c pathspec handling of merges · a8b5f116
      This fixes the way the example log program decides if a merge
      commit should be shown when a pathspec is given.  Also makes it
      easier to use the pathspec API to just check "does a tree match
      anything in the pathspec" without allocating a match list.
      Russell Belfer committed
    • Add public API for pathspec matching · d2ce27dd
      This adds a new public API for compiling pathspecs and matching
      them against the working directory, the index, or a tree from the
      repository.  This also reworks the pathspec internals to allow the
      sharing of code between the existing internal usage of pathspec
      matching and the new external API.
      
      While this is working and the new API is ready for discussion, I
      think there is still an incorrect behavior in which patterns are
      always matched against the full path of an entry without taking
      the subdirectories into account (so "s*" will match "subdir/file"
      even though it wouldn't with core Git).  Further enhancements are
      coming, but this was a good place to take a functional snapshot.
      Russell Belfer committed
  2. 09 Jul, 2013 3 commits
  3. 03 Jul, 2013 1 commit
  4. 02 Jul, 2013 1 commit
  5. 30 Jun, 2013 1 commit
  6. 24 Jun, 2013 2 commits
    • libgit2 v0.19.0 "gut merge" · eddc1f1e
      Minor point release! We got a lot of rather large features that we
      wanted to get settled in:
      
      - New (threadsafe) cache for objects
      - Iterator for Status
      - New Merge APIs
      - SSH support on *NIX
      - Function context on diff
      - Namespaces support
      - Index add/update/remove with wildcard support
      - Iterator for References
      - Fetch and push refspecs for Remotes
      - Rename support in Status
      - New 'sys/` namespace for external headers with low-level APIs
      
      As always, this comes with hundreds of bug fixes and performance
      improvements. We're faster and better than ever. And we haven't broken
      many APIs this time!
      
      Build stuff.
      Vicent Marti committed
    • Fixed most documentation header bugs · e1967164
      Fixed a few header @param and @return typos with the help of -Wdocumentation in Xcode.
      
      The following warnings have not been fixed:
      common.h:213 - Not sure how the documentation format is for '...'
      notes.h:102 - Correct @param name but empty text
      notes.h:111 - Correct @param name but empty text
      pack.h:140 - @return missing text
      pack.h:148 - @return missing text
      Andreas Linde committed
  7. 21 Jun, 2013 2 commits
    • Add target directory to checkout · 9094ae5a
      This adds the ability for checkout to write to a target directory
      instead of having to use the working directory of the repository.
      This makes it easier to do exports of repository data and the like.
      
      This is similar to, but not quite the same as, the --prefix option
      to `git checkout-index` (this will always be treated as a directory
      name, not just as a simple text prefix).
      
      As part of this, the workdir iterator was extended to take the
      path to the working directory as a parameter and fallback on the
      git_repository_workdir result only if it's not specified.
      
      Fixes #1332
      Russell Belfer committed
    • Fix checkout of modified file when missing from wd · 36fd9e30
      This fixes the checkout case when a file is modified between the
      baseline and the target and yet missing in the working directory.
      The logic for that case appears to have been wrong.
      
      This also adds a useful checkout notify callback to the checkout
      test helpers that will count notifications and also has a debug
      mode to visualize what checkout thinks that it's doing.
      Russell Belfer committed
  8. 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
  9. 19 Jun, 2013 1 commit
    • Add index pathspec-based operations · f30fff45
      This adds three new public APIs for manipulating the index:
      
      1. `git_index_add_all` is similar to `git add -A` and will add
         files in the working directory that match a pathspec to the
         index while honoring ignores, etc.
      2. `git_index_remove_all` removes files from the index that match
         a pathspec.
      3. `git_index_update_all` updates entries in the index based on
         the current contents of the working directory, either added
         the new information or removing the entry from the index.
      Russell Belfer committed
  10. 18 Jun, 2013 1 commit
    • Add "as_path" parameters to blob and buffer diffs · 74ded024
      This adds parameters to the four functions that allow for blob-to-
      blob and blob-to-buffer differencing (either via callbacks or by
      making a git_diff_patch object).  These parameters let you say
      that filename we should pretend the blob has while doing the diff.
      If you pass NULL, there should be no change from the existing
      behavior, which is to skip using attributes for file type checks
      and just look at content.  With the parameters, you can plug into
      the new diff driver functionality and get binary or non-binary
      behavior, plus function context regular expressions, etc.
      
      This commit also fixes things so that the git_diff_delta that is
      generated by these functions will actually be populated with the
      data that we know about the blobs (or buffers) so you can use it
      appropriately.  It also fixes a bug in generating patches from
      the git_diff_patch objects created via these functions.
      
      Lastly, there is one other behavior change that may matter.  If
      there is no difference between the two blobs, these functions no
      longer generate any diff callbacks / patches unless you have
      passed in GIT_DIFF_INCLUDE_UNMODIFIED.  This is pretty natural,
      but could potentially change the behavior of existing usage.
      Russell Belfer committed
  11. 17 Jun, 2013 3 commits
  12. 12 Jun, 2013 1 commit
    • Add patch from blobs API · f9c824c5
      This adds two new public APIs: git_diff_patch_from_blobs and
      git_diff_patch_from_blob_and_buffer, plus it refactors the code
      for git_diff_blobs and git_diff_blob_to_buffer so that they code
      is almost entirely shared between these APIs, and adds tests for
      the new APIs.
      Russell Belfer committed
  13. 11 Jun, 2013 2 commits
  14. 31 May, 2013 1 commit
  15. 30 May, 2013 2 commits
  16. 29 May, 2013 1 commit
  17. 28 May, 2013 2 commits
  18. 27 May, 2013 1 commit
  19. 26 May, 2013 1 commit
  20. 24 May, 2013 4 commits
  21. 23 May, 2013 2 commits
    • More diff rename tests; better split swap handling · 67db583d
      This adds a couple more tests of different rename scenarios.
      
      Also, this fixes a problem with the case where you have two
      "split" deltas and the left half of one matches the right half of
      the other.  That case was already being handled, but in the wrong
      order in a way that could result in bad output.  Also, if the swap
      also happened to put the other two halves into the correct place
      (i.e. two files exchanged places with each other), then the second
      delta was left with the SPLIT flag set when it really should be
      cleared.
      Russell Belfer committed
  22. 22 May, 2013 1 commit
    • Significant rename detection rewrite · a21cbb12
      This flips rename detection around so instead of creating a
      forward mapping from deltas to possible rename targets, instead
      it creates a reverse mapping, looking at possible targets and
      trying to find a source that they could have been renamed or
      copied from.  This is important because each output can only
      have a single source, but a given source could map to multiple
      outputs (in the form of COPIED records).
      
      Additionally, this makes a couple of tweaks to the public rename
      detection APIs, mostly renaming a couple of options that control
      the behavior to make more sense and to be more like core Git.
      
      I walked through the tests looking at the exact results and
      updated the expectations based on what I saw.  The new code is
      different from the old because it cannot give some nonsense
      results (like A was renamed to both B and C) which were part of
      the outputs previously.
      Russell Belfer committed
  23. 21 May, 2013 1 commit