gitignore.rs icon indicating copy to clipboard operation
gitignore.rs copied to clipboard

Recurse ignore files in repo

Open bkuster opened this issue 2 years ago • 0 comments

Features

  • The repo correctly recurses over a given path, picking out the correct ignore files to apply.
  • Added a new ignore result enum IgnoreResult: A path can either be ignored, negated or undefined given a certain ruleset. This allows to properly map negation of child .gitignores

Issues not addressed by this MR

What if a negation is less specific then a directory exclude? Say we pass in the path some_dir/foo.rs with the given .gitignore:

some_dir/
!foo.rs

a spec was added for this case.

This rule is specified in the gitgnore docs as:

It is not possible to re-include a file if a parent directory of that file is excluded.

bkuster avatar Apr 03 '22 08:04 bkuster