sapling/eden/fs/docs/Globbing.md
Chad Austin 65d278cc55 move docs/ into eden/fs/
Summary: These docs are all EdenFS specific so move them into the fs/ directory.

Reviewed By: genevievehelsel

Differential Revision: D21329620

fbshipit-source-id: 4090ed4ca371d01ea98e06ad6ce8f434c0660962
2020-05-04 12:34:47 -07: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.