LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-file-search

searches file contents in a Jujutsu revision

TLDR

Search the working copy for a regex
$ jj file search -p "[regex]"
copy
Search with a glob that must match the whole line
$ jj file search -p "glob:*[pattern]*"
copy
Search a specific revision
$ jj file search -r [revision] -p "[pattern]"
copy
Search only under given paths
$ jj file search -p "[pattern]" [path/to/file_or_directory]
copy
Print matching paths only
$ jj file search -p "[pattern]" --name-only
copy
Prefix each match with its line number
$ jj file search -p "[pattern]" -n
copy

SYNOPSIS

jj file search [options] --pattern PATTERN [filesets...]

DESCRIPTION

jj file search prints each line that matches the given pattern, prefixed by the file path. It searches the tree of a revision (default @), not an on-disk working tree that may include untracked files.Patterns use the same string-pattern syntax as revsets. Omit the kind to treat the pattern as a regular expression. For a glob, the whole line must match, so wrap the text: `--pattern 'glob:*foo*'`. See the revsets documentation for the full pattern language.

PARAMETERS

-p, --pattern PATTERN

Pattern to search for on a single line. Uses Jujutsu string-pattern syntax (`kind:pattern`). The kind defaults to regex when omitted.
FILESETS
Only search files matching these prefixes. Default: all files in the revision.
-r, --revision REVSET
Revision to search (default: working-copy commit @).
--name-only
Print only paths of files that contain a match, not the matched lines.
-n, --line-number
Prefix each matched line with its 1-based line number within the file.

INSTALL

sudo pacman -S jujutsu
copy
sudo apk add jujutsu
copy
sudo zypper install jujutsu
copy
brew install jujutsu
copy
nix profile install nixpkgs#jujutsu
copy

CAVEATS

Subcommand of jj. --pattern is required. This is an early version of the command and does not search files concurrently. Glob patterns match the entire line, not a substring.

SEE ALSO

jj-file(1), jj-file-list(1), grep(1), git-grep(1), jj(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid