sapling/eden/fs/model
Michael Bolin 5e5ee6c32d Extend GlobMatcher to support an IGNORE_DOTFILES option.
Summary:
When `GlobMatcher` is used to implement `glob()` for Eden, `**` should not
include dotfiles by default (at least when it is used to implement `glob()` in Buck),
so we need to make this configurable. To this end, this adds a `GlobOptions`
parameter to `GlobMatcher::create()`. The key option this revision introduces is
`GlobOptions::IGNORE_DOTFILES`.

We implement this new functionality by associating a `matchCanStartWithDot`
boolean with the following opcodes in `GlobMatcher`:

* `GLOB_STAR`
* `GLOB_STAR_STAR_END`
* `GLOB_STAR_STAR_SLASH`
* `GLOB_ENDS_WITH`

The value of `matchCanStartWithDot` is largely determined by
`GlobOptions::IGNORE_DOTFILES`, though some extra checking is done
when assigning this for `GLOB_STAR`.

Originally, `GLOB_ENDS_WITH` required some funny business in how it
manipulated the `result` vector. This revision introduces some new funny
business to preserve the desired optimization.

Most of the work in this revision is new logic to ensure `matchCanStartWithDot`
is honored appropriately for each opcode.

Reviewed By: simpkins

Differential Revision: D7787621

fbshipit-source-id: f2c42e0f0948db74d48dc163d40aa3b13bbb4c3d
2018-05-02 12:21:04 -07:00
..
git Extend GlobMatcher to support an IGNORE_DOTFILES option. 2018-05-02 12:21:04 -07:00
test Remove TARGETS files 2018-02-20 19:57:45 -08:00
Blob.h run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
CMakeLists.txt add CMake build files 2018-04-30 14:37:46 -07:00
Hash.cpp replaced std::size_t by size_t in fbcode/eden codebase. 2018-02-20 15:30:18 -08:00
Hash.h replaced std::size_t by size_t in fbcode/eden codebase. 2018-02-20 15:30:18 -08:00
ParentCommits.cpp run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
ParentCommits.h run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
Tree.cpp run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
Tree.h run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
TreeEntry.cpp move folly/experimental/logging to folly/logging/ 2018-04-30 21:29:29 -07:00
TreeEntry.h simplify isSameAs checking of mode bits 2018-02-20 11:36:11 -08:00