1. 09 Oct, 2012 1 commit
  2. 08 Oct, 2012 1 commit
  3. 27 Sep, 2012 1 commit
  4. 17 Sep, 2012 1 commit
  5. 06 Sep, 2012 3 commits
    • Implement filters for status/diff blobs · 60b9d3fc
      This adds support to diff and status for running filters (a la crlf)
      on blobs in the workdir before computing SHAs and before generating
      text diffs.  This ended up being a bit more code change than I had
      thought since I had to reorganize some of the diff logic to minimize
      peak memory use when filtering blobs in a diff.
      
      This also adds a cap on the maximum size of data that will be loaded
      to diff.  I set it at 512Mb which should match core git.  Right now
      it is a #define in src/diff.h but it could be moved into the public
      API if desired.
      Russell Belfer committed
    • Alternate test for autocrlf with status · f8e2cc9a
      I couldn't get the last failing test to actually fail.  This
      is a different test suggested by @nulltoken which should fail.
      Russell Belfer committed
    • Test case to reproduce issue #690. · 52462e1c
      Staged file status does not handle CRLF correctly. Ensures that the test repo has core.autocrlf=true for the test to fail.
      pontusm committed
  6. 24 Aug, 2012 3 commits
    • Fix crash with adding internal ignores · 11684104
      Depending on what you had done before adding new items to the
      internal ignores list, it was possible for the cache of ignore
      data to be uninitialized.
      Russell Belfer committed
    • Working implementation of git_submodule_status · 5f4a61ae
      This is a big redesign of the git_submodule_status API and the
      implementation of the redesigned API.  It also fixes a number of
      bugs that I found in other parts of the submodule API while
      writing the tests for the status part.
      
      This also fixes a couple of bugs in the iterators that had not
      been noticed before - one with iterating when there is a gitlink
      (i.e. separate-work-dir) and one where I was treating anything
      even vaguely submodule-like as a submodule, more aggressively
      than core git does.
      Russell Belfer committed
    • Major submodule rewrite · aa13bf05
      This replaces the old submodule API with a new extended API that
      supports most of the things that can be done with `git submodule`.
      Russell Belfer committed
  7. 23 Aug, 2012 1 commit
  8. 22 Aug, 2012 1 commit
  9. 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
  10. 30 Jul, 2012 1 commit
  11. 25 Jul, 2012 1 commit
  12. 24 Jul, 2012 3 commits
  13. 11 Jul, 2012 1 commit
    • Add flag to write gitlink on setting repo workdir · 991a56c7
      This added a flag to the `git_repository_set_workdir()` function
      that enables generation of a `.git` gitlink file that links the
      new workdir to the parent repository.  Essentially, the flag tells
      the function to write out the changes to disk to permanently set
      the workdir of the repository to the new path.
      
      If you pass this flag as true, then setting the workdir to something
      other than the default workdir (i.e. the parent of the .git repo
      directory), will create a plain file named ".git" with the standard
      gitlink contents "gitdir: <repo-path>", and also update the
      "core.worktree" and "core.bare" config values.
      
      Setting the workdir to the default repo workdir will clear the
      core.worktree flag (but still permanently set core.bare to false).
      
      BTW, the libgit2 API does not currently provide a function for
      clearing the workdir and converting a non-bare repo into a bare one.
      Russell Belfer committed
  14. 09 Jun, 2012 1 commit
  15. 08 Jun, 2012 1 commit
    • Fix filemode comparison in diffs · 0abd7244
      File modes were both not being ignored properly on platforms
      where they should be ignored, nor be diffed consistently on
      platforms where they are supported.
      
      This change adds a number of diff and status filemode change
      tests.  This also makes sure that filemode-only changes are
      included in the diff output when they occur and that filemode
      changes are ignored successfully when core.filemode is false.
      
      There is no code that automatically toggles core.filemode
      based on the capabilities of the current platform, so the user
      still needs to be careful in their .git/config file.
      Russell Belfer committed
  16. 07 Jun, 2012 1 commit
    • Fix git_status_file for files that start with a character > 0x7f · 8e60c712
      git_status_file would always return GIT_ENOTFOUND for these files.
      
      The underlying bug was that git__strcmp_cb, which is used by
      git_path_with_stat_cmp to sort entries in the working directory,
      compares strings based on unsigned chars (this is confirmed by the
      strcmp(3) manpage), while git__prefixcmp, which is used by
      workdir_iterator__entry_cmp to search for a path in the working
      directory, compares strings based on char. So the sort puts this path at
      the end of the list, while the search expects it to be at the beginning.
      
      The fix was simply to make git__prefixcmp compare using unsigned chars,
      just like strcmp(3). The rest of the change is just adding/updating
      tests.
      Adam Roben committed
  17. 25 May, 2012 1 commit
    • Fix bugs for status with spaces and reloaded attrs · 2a99df69
      This fixes two bugs:
      
      * Issue #728 where git_status_file was not working for files
        that contain spaces.  This was caused by reusing the "fnmatch"
        parsing code from ignore and attribute files to interpret the
        "pathspec" that constrained the files to apply the status to.
        In that code, unescaped whitespace was considered terminal to
        the pattern, so a file with internal whitespace was excluded
        from the matched files.  The fix was to add a mode to that code
        that allows spaces and tabs inside patterns.  This mode only
        comes into play when parsing in-memory strings.
      
      * The other issue was undetected, but it was in the recently
        added code to reload gitattributes / gitignores when they were
        changed on disk.  That code was not clearing out the old values
        from the cached file content before reparsing which meant that
        newly added patterns would be read in, but deleted patterns
        would not be removed.  The fix was to clear the vector of
        patterns in a cached file before reparsing the file.
      Russell Belfer committed
  18. 17 May, 2012 4 commits
    • Fix workdir iterators on empty directories · 6e5c4af0
      Creating a workdir iterator on a directory with absolutely
      no files was returning an error (GIT_ENOTFOUND) instead of
      an iterator for nothing.  This fixes that and includes two
      new tests that cover that case.
      Russell Belfer committed
    • Fix status for files under ignored dirs · bd4ca902
      There was a bug where tracked files inside directories that were
      inside ignored directories where not being found by status.  To
      make that a little clearer, if you have a .gitignore with:
      
          ignore/
      
      And then have the following files:
      
          ignore/dir/tracked     <-- actually a tracked file
          ignore/dir/untracked   <-- should be ignored
      
      Then we would show the tracked file as being removed (because
      when we got the to contained item "dir/" inside the ignored
      directory, we decided it was safe to skip -- bzzt, wrong!).
      
      This update is much more careful about checking that we are
      not skipping over any prefix of a tracked item, regardless of
      whether it is ignored or not.
      
      As documented in diff.c, this commit does create behavior that
      still differs from core git with regards to the handling of
      untracked files contained inside ignored directories.  With
      libgit2, those files will just not show up in status or diff.
      With core git, those files don't show up in status or diff
      either *unless* they are explicitly ignored by a .gitignore
      pattern in which case they show up as ignored files.
      
      Needless to say, this is a local behavior difference only, so
      it should not be important and (to me) the libgit2 behavior
      seems more consistent.
      Russell Belfer committed
  19. 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
  20. 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
  21. 08 May, 2012 3 commits
  22. 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
  23. 26 Apr, 2012 1 commit
  24. 17 Apr, 2012 1 commit
  25. 10 Apr, 2012 1 commit
  26. 04 Apr, 2012 1 commit
  27. 28 Mar, 2012 1 commit
    • Added submodule API and use in status · bfc9ca59
      When processing status for a newly checked out repo, it is
      possible that there will be submodules that have not yet been
      initialized.  The only way to distinguish these from untracked
      directories is to have some knowledge of submodules.  This
      commit adds a new submodule API which, given a name or path,
      can determine if it appears to be a submodule and can give
      information about the submodule.
      Russell Belfer committed
  28. 26 Mar, 2012 1 commit
  29. 23 Mar, 2012 1 commit