rust-lang/glob — pull request #15 by blaenk (2014-12-26 21:56:04+00:00)
Title: implement recursive wildstars

A sequence of two consecutive wildstars, `**`, acts like a regular wildstar `*` except that it also matches on path separators, making them useful for matching on arbitrary subdirectories.

For example, the pattern `"somedir/**/needle.txt"` would match:

* `somedir/one/needle.txt`
* `somedir/one/two/needle.txt`
* `somedir/other/needle.txt`

Patterns such as `"somedir/**/*.txt"` are also possible.

The previous behavior of collapsing many consecutive wildcards to a single one has been changed so that now a sequence of more than two consecutive wildcards is treated literally.

[Python](https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob) and [Ruby](http://ruby-doc.org/core-2.2.0/Dir.html#method-c-glob), for example, also support recursive glob patterns.

The implementation simply makes `**` ignore `require_literal_separator`. It could be that this flag is now unnecessary, since the behavior of `require_literal_separator: false` can be enacted through the use of `**`, which in my opinion is more ergonomic than having to use `matches_with` and a `MatchOptions` value.

All tests pass and I added some tests for this.