sincecutoff.com
← all changes

`file search` pattern kinds and default

Introduced 2026-05-07 · score 0.92

HOW TO USE IT

When searching repository files, run `jj file search` with `--pattern`; an unprefixed pattern now uses regex matching. Prefix the pattern with `glob:` when you want glob matching.

jj file search --pattern 'regex:<regular-expression>'
jj file search --pattern 'glob:<glob-pattern>' <fileset>

WHY THIS HELPS

Search repository files using a glob or regular-expression pattern.

BEFORE THIS CHANGE

The `--pattern` default was `glob:`; prefix the pattern with `regex:` to use regular-expression matching.

REQUIREMENTS AND LIMITATIONS

  • Version: v0.41.0
  • --pattern <PATTERN> (required): Pattern to search for in a single line. Supports `exact:`, `glob:`, `regex:`, and `substring:`; omitted kind defaults to regex. `glob:` must match the whole line. Pattern kinds are alternatives, not mutually exclusive options.
  • <REVSET> (`-r`, `--revision`): Revision to search; defaults to `@`.
  • <FILESETS>: Optional file path prefixes to search instead of all files.
  • exact:: Match strings exactly equal to the pattern.
  • glob:: Match using Unix-style shell wildcards.
  • regex:: Match substrings using a regular expression.
  • substring:: Match strings containing the pattern.
  • The `--pattern` flag accepts various pattern kinds through `kind:pattern` syntax.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card