1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-02 02:56:32 +02:00

doc: add docs about .ignore/.rgignore in parent directories

Closes #2479
This commit is contained in:
Andrew Gallant 2023-11-21 20:18:22 -05:00
parent b7df9f8caa
commit 58e7d2ea63
4 changed files with 19 additions and 9 deletions

View File

@ -75,6 +75,8 @@ Bug fixes:
Make `-p/--pretty` override flags like `--no-line-number`.
* [BUG #2392](https://github.com/BurntSushi/ripgrep/issues/2392):
Improve global git config parsing of the `excludesFile` field.
* [BUG #2479](https://github.com/BurntSushi/ripgrep/issues/2479):
Add documentation about `.ignore`/`.rgignore` files in parent directories.
* [BUG #2480](https://github.com/BurntSushi/ripgrep/issues/2480):
Fix bug when using inline regex flags with `-e/--regexp`.
* [BUG #2519](https://github.com/BurntSushi/ripgrep/issues/2519):

View File

@ -178,11 +178,15 @@ search. By default, when you search a directory, ripgrep will ignore all of
the following:
1. Files and directories that match glob patterns in these three categories:
1. gitignore globs (including global and repo-specific globs).
1. `.gitignore` globs (including global and repo-specific globs). This
includes `.gitignore` files in parent directories that are part of the
same `git` repository. (Unless the `--no-require-git` flag is given.)
2. `.ignore` globs, which take precedence over all gitignore globs
when there's a conflict.
when there's a conflict. This includes `.ignore` files in parent
directories.
3. `.rgignore` globs, which take precedence over all `.ignore` globs
when there's a conflict.
when there's a conflict. This includes `.rgignore` files in parent
directories.
2. Hidden files and directories.
3. Binary files. (ripgrep considers any file with a `NUL` byte to be binary.)
4. Symbolic links aren't followed.
@ -190,7 +194,7 @@ the following:
All of these things can be toggled using various flags provided by ripgrep:
1. You can disable all ignore-related filtering with the `--no-ignore` flag.
2. Hidden files and directories can be searched with the `--hidden` (`-.` for
2. Hidden files and directories can be searched with the `--hidden` (`-.` for
short) flag.
3. Binary files can be searched via the `--text` (`-a` for short) flag.
Be careful with this flag! Binary files may emit control characters to your
@ -997,7 +1001,7 @@ used options that will likely impact how you use ripgrep on a regular basis.
if the pattern contains any uppercase letters. Usually this flag is put into
alias or a config file.
* `-F/--fixed-strings`: Disable regular expression matching and treat the pattern
as a literal string.
as a literal string.
* `-w/--word-regexp`: Require that all matches of the pattern be surrounded
by word boundaries. That is, given `pattern`, the `--word-regexp` flag will
cause ripgrep to behave as if `pattern` were actually `\b(?:pattern)\b`.

View File

@ -4734,7 +4734,7 @@ impl Flag for NoRequireGit {
fn doc_long(&self) -> &'static str {
r"
When this flag is given, source control ignore files such as \fB.gitignore\fP
are respect even if no \fBgit\fP repository is present.
are respected even if no \fBgit\fP repository is present.
.sp
By default, ripgrep will only respect filter rules from source control ignore
files when ripgrep detects that the search is executed inside a source control

View File

@ -165,7 +165,9 @@ this includes the following:
Any global rules, e.g., in \fB$HOME/.config/git/ignore\fP.
.
.IP \(bu 3n
Any rules in relevant \fB.gitignore\fP files.
Any rules in relevant \fB.gitignore\fP files. This includes \fB.gitignore\fP
files in parent directories that are part of the same \fBgit\fP repository.
(Unless \fB\-\-no\-require\-git\fP is given.)
.
.IP \(bu 3n
Any local rules, e.g., in \fB.git/info/exclude\fP.
@ -180,10 +182,12 @@ precisely, or otherwise use \fBgit grep\fP for search.
Additional ignore rules can be provided outside of a \fBgit\fP context:
.
.IP \(bu 3n
Any rules in \fB.ignore\fP.
Any rules in \fB.ignore\fP. ripgrep will also respect \fB.ignore\fP files in
parent directories.
.
.IP \(bu 3n
Any rules in \fB.rgignore\fP.
Any rules in \fB.rgignore\fP. ripgrep will also respect \fB.rgignore\fP files
in parent directories.
.
.IP \(bu 3n
Any rules in files specified with the \fB\-\-ignore\-file\fP flag.