sapling/eden/fs/docs/Globbing.md
Michael Cuevas 2b1e0aa0f8 Update Globbing doc headings to use title case
Summary: Other docs use title case for headings. This one should too!

Reviewed By: genevievehelsel

Differential Revision: D32623259

fbshipit-source-id: a569ce1538ad6c963e41a4fa7aef4127f1e2b730
2021-11-24 08:31:59 -08:00

1.6 KiB

EdenFS File Globs

EdenFS supports glob patterns through the following interfaces:

  • Ignore files (e.g. .gitignore)
  • globFiles Thrift API

Ignore Files

EdenFS uses ignore files to exclude files in the getScmStatus Thrift API (used by hg status, for example). The syntax for EdenFS' ignore files is compatible with the syntax for gitignore files used by the Git version control system, even when an EdenFS checkout is backed by a Mercurial repository.

Glob Pattern Magic

EdenFS interprets the following tokens specially within glob patterns:

  • **: Match zero, one, or more path components.
  • *: Match zero, one, or more valid path component characters.
  • ?: Match exactly one valid path component characters.
  • [: Match exactly one path component character in the given set of characters. The set is terminated by ].
  • [!, [^: Match exactly one path component character not in the given set of characters. The set is terminated by ].

EdenFS glob patterns are compatible with gitignore patterns used by the Git version control system, even when an EdenFS checkout is backed by a Mercurial repository.

If a glob pattern matches a symlink exactly, globFile returns the symlink itself (and not its target) as a match.

If a prefix of a glob pattern matches a symlink, globFile does not return the symlink as a match, does not return the symlink's target as a match, and does not resolve the symlink in order to continue matching the glob pattern.