1. 20 May, 2015 1 commit
  2. 17 Apr, 2015 1 commit
  3. 05 Dec, 2014 1 commit
  4. 23 Nov, 2014 1 commit
  5. 06 Nov, 2014 1 commit
  6. 05 Nov, 2014 1 commit
  7. 08 Aug, 2014 2 commits
    • Demonstrate a trailing slash failure. · bbe13802
      `git help ignore` has this to say about trailing slashes:
      
      > If the pattern ends with a slash, it is removed for the purpose of
      > the following description, but it would only find a match with a
      > directory. In other words, foo/ will match a directory foo and
      > paths underneath it, but will not match a regular file or a
      > symbolic link foo (this is consistent with the way how pathspec
      > works in general in Git).
      
      Sure enough, having manually performed the same steps as this test,
      `git status` tells us the following:
      
      	# On branch master
      	#
      	# Initial commit
      	#
      	# Changes to be committed:
      	#   (use "git rm --cached <file>..." to unstage)
      	#
      	#	new file:   force.txt
      	#
      	# Untracked files:
      	#   (use "git add <file>..." to include in what will be committed)
      	#
      	#	../.gitignore
      	#	child1/
      	#	child2/
      
      i.e. neither child1 nor child2 is ignored.
      Rob Rix committed
    • status: failing test with slash-star · aa5cdf63
      When writing 'bin/*' in the rules, this means we ignore very file inside
      bin/ individually, but do not ignore the directory itself. Thus the
      status listing should list both files under bin/, one untracked and one
      ignored.
      Carlos Martín Nieto committed
  8. 06 May, 2014 1 commit
    • Improve checks for ignore containment · f554611a
      The diff code was using an "ignored_prefix" directory to track if
      a parent directory was ignored that contained untracked files
      alongside tracked files. Unfortunately, when negative ignore rules
      were used for directories inside ignored parents, the wrong rules
      were applied to untracked files inside the negatively ignored
      child directories.
      
      This commit moves the logic for ignore containment into the workdir
      iterator (which is a better place for it), so the ignored-ness of
      a directory is contained in the frame stack during traversal.  This
      allows a child directory to override with a negative ignore and yet
      still restore the ignored state of the parent when we traverse out
      of the child.
      
      Along with this, there are some problems with "directory only"
      ignore rules on container directories.  Given "a/*" and "!a/b/c/"
      (where the second rule is a directory rule but the first rule is
      just a generic prefix rule), then the directory only constraint
      was having "a/b/c/d/file" match the first rule and not the second.
      This was fixed by having ignore directory-only rules test a rule
      against the prefix of a file with LEADINGDIR enabled.
      
      Lastly, spot checks for ignores using `git_ignore_path_is_ignored`
      were tested from the top directory down to the bottom to deal with
      the containment problem, but this is wrong. We have to test bottom
      to top so that negative subdirectory rules will be checked before
      parent ignore rules.
      
      This does change the behavior of some existing tests, but it seems
      only to bring us more in line with core Git, so I think those
      changes are acceptable.
      Russell Belfer committed
  9. 02 May, 2014 1 commit
    • Improve handling of fake home directory · 0f603132
      There are a few tests that set up a fake home directory and a
      fake GLOBAL search path so that we can test things in global
      ignore or attribute or config files.  This cleans up that code to
      work more robustly even if there is a test failure.  This also
      fixes some valgrind warnings where scanning search paths for
      separators could end up doing a little bit of sketchy data access
      when coming to the end of search list.
      Russell Belfer committed
  10. 18 Apr, 2014 3 commits
    • Fix ignore difference from git with trailing /* · 916fcbd6
      Ignore patterns that ended with a trailing '/*' were still needing
      to match against another actual '/' character in the full path.
      This is not the same behavior as core Git.
      
      Instead, we strip a trailing '/*' off of any patterns that were
      matching and just take it to imply the FNM_LEADING_DIR behavior.
      Russell Belfer committed
    • Pop ignore only if whole relative path matches · 6a0956e5
      When traversing the directory structure, the iterator pushes and
      pops ignore files using a vector.  Some directories don't have
      ignore files, so it uses a path comparison to decide when it is
      right to actually pop the last ignore file.  This was only
      comparing directory suffixes, though, so a subdirectory with the
      same name as a parent could result in the parent's .gitignore
      being popped off the list ignores too early.  This changes the
      logic to compare the entire relative path of the ignore file.
      Russell Belfer committed
  11. 17 Apr, 2014 1 commit
  12. 14 Apr, 2014 1 commit
    • Fix core.excludesfile named .gitignore · a9528b8f
      Ignore rules with slashes in them are matched using FNM_PATHNAME
      and use the path to the .gitignore file from the root of the
      repository along with the path fragment (including slashes) in
      the ignore file itself.  Unfortunately, the relative path to the
      .gitignore file was being applied to the global core.excludesfile
      if that was also named ".gitignore".
      
      This fixes that with more precise matching and includes test for
      ignore rules with leading slashes (which were the primary example
      of this being broken in the real world).
      
      This also backports an improvement to the file context logic from
      the threadsafe-iterators branch where we don't rely on mutating
      the key of the attribute file name to generate the context path.
      Russell Belfer committed
  13. 10 Apr, 2014 1 commit
    • Fix bug popping ignore files during wd iteration · 8f7bc646
      There were a couple bugs in popping ignore files during iteration
      that could result in incorrect decisions be made and thus ignore
      files below the root either not being loaded correctly or not
      being popped at the right time.
      
      One bug was an off-by-one in comparing the path of the gitignore
      file with the path being exited during iteration.
      
      The second bug was not correctly truncating the path being tracked
      during traversal if there were no ignores on the list (i.e. when
      you have no .gitignore at the root, but do have some in contained
      directories).
      Russell Belfer committed
  14. 14 Nov, 2013 1 commit
  15. 09 Aug, 2013 1 commit
    • Improve building ignore file lists · ba8b8c04
      The routines to push and pop ignore files while traversing a
      directory had some issues. In particular, setting up the initial
      list would sometimes push an ignore file before it ought to be
      applied if the starting path was a directory containing an ignore
      file. Also, the pop function was not always matching the right
      part of the path and would fail to pop ignores from the list in
      some cases.
      
      This adds some tests that exercise a particular problematic case
      and then fixes the problems that I could find related to this.
      
      At some point, I'd like to isolate this ignore rule management
      code and rewrite it, but that's a larger project and right now,
      I'll opt to just try to fix the broken behaviors.
      Russell Belfer committed
  16. 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
  17. 15 Apr, 2013 1 commit
  18. 26 Mar, 2013 2 commits
    • Fix some diff ignores and submodule dirty workdir · ccfa6805
      This started out trying to look at the problems from issue #1425
      and gradually grew to a broader set of fixes.  There are two core
      things fixed here:
      
      1. When you had an ignore like "/bin" which is rooted at the top
         of your tree, instead of immediately adding the "bin/" entry
         as an ignored item in the diff, we were returning all of the
         direct descendants of the directory as ignored items.  This
         changes things to immediately ignore the directory.  Note that
         this effects the behavior in test_status_ignore__subdirectories
         so that we no longer exactly match core gits ignore behavior,
         but the new behavior probably makes more sense (i.e. we now
         will include an ignored directory inside an untracked directory
         that we previously would have left off).
      2. When a submodule only contained working directory changes, the
         diff code was always considering it unmodified which was just
         an outright bug. The HEAD SHA of the submodule matches the SHA
         in the parent repo index, and since the SHAs matches, the diff
         code was overwriting the actual status with UNMODIFIED.
      
      These fixes broke existing tests test_diff_workdir__submodules and
      test_status_ignore__subdirectories but looking it over, I actually
      think the new results are correct and the old results were wrong.
      @nulltoken had actually commented on the subdirectory ignore issue
      previously.
      
      I also included in the tests some debugging versions of the
      shared iteration callback routines that print status or diff
      information.  These aren't used actively in the tests, but can be
      quickly swapped in to test code to give a better picture of what
      is being scanned in some of the complex test scenarios.
      Russell Belfer committed
    • 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
  19. 25 Mar, 2013 1 commit
  20. 30 Nov, 2012 1 commit
  21. 20 Nov, 2012 1 commit
  22. 16 Oct, 2012 1 commit
  23. 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
  24. 09 Oct, 2012 1 commit
  25. 08 Oct, 2012 1 commit
  26. 24 Aug, 2012 1 commit
  27. 22 Aug, 2012 1 commit
  28. 09 Jun, 2012 1 commit
  29. 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
  30. 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
  31. 26 Apr, 2012 1 commit
  32. 16 Mar, 2012 1 commit
  33. 02 Mar, 2012 1 commit
    • Clean up GIT_UNUSED macros on all platforms · 854eccbb
      It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5
      did not fix the GIT_USUSED behavior on all platforms.  This commit
      walks through and really cleans things up more thoroughly, getting
      rid of the unnecessary stuff.
      
      To remove the use of some GIT_UNUSED, I ended up adding a couple
      of new iterators for hashtables that allow you to iterator just
      over keys or just over values.
      
      In making this change, I found a bug in the clar tests (where we
      were doing *count++ but meant to do (*count)++ to increment the
      value).  I fixed that but then found the test failing because it
      was not really using an empty repo.  So, I took some of the code
      that I wrote for iterator testing and moved it to clar_helpers.c,
      then made use of that to make it easier to open fixtures on a
      per test basis even within a single test file.
      Russell Belfer committed
  34. 01 Feb, 2012 1 commit
  35. 25 Jan, 2012 1 commit
  36. 17 Jan, 2012 1 commit
    • Fix handling of relative paths for attrs · a51cd8e6
      Per issue #533, the handling of relative paths in attribute
      and ignore files was not right.  Fixed this by pre-joining
      the relative path of the attribute/ignore file onto the match
      string when a full path match is required.
      
      Unfortunately, fixing this required a bit more code than I
      would have liked because I had to juggle things around so that
      the fnmatch parser would have sufficient information to prepend
      the relative path when it was needed.
      Russell Belfer committed