Skip to content

Commit

Permalink
Switch from .rgignore to .ignore.
Browse files Browse the repository at this point in the history
But don't actually remove support for .rgignore until the next semver
bump.

Note that this puts us in line with the silver searcher:
ggreer/the_silver_searcher#974

Fixes BurntSushi#40
  • Loading branch information
amsharma91 committed Sep 20, 2016
1 parent a9c8e1e commit 46a34f5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ files, ignore hidden files and directories and skip binary files:
$ rg foobar
```

The above command also respects all `.rgignore` files, including in parent
directories. `.rgignore` files can be used when `.gitignore` files are
insufficient. In all cases, `.rgignore` patterns take precedence over
The above command also respects all `.ignore` files, including in parent
directories. `.ignore` files can be used when `.gitignore` files are
insufficient. In all cases, `.ignore` patterns take precedence over
`.gitignore`.

To ignore all ignore files, use `-u`. To additionally search hidden files
Expand Down
4 changes: 2 additions & 2 deletions doc/rg.1
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ Never use memory maps, even when they might be faster.
.RE
.TP
.B \-\-no\-ignore
Don\[aq]t respect ignore files (.gitignore, .rgignore, etc.) This
implies \-\-no\-ignore\-parent.
Don\[aq]t respect ignore files (.gitignore, .ignore, etc.) This implies
\-\-no\-ignore\-parent.
.RS
.RE
.TP
Expand Down
2 changes: 1 addition & 1 deletion doc/rg.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ the raw speed of grep.
: Never use memory maps, even when they might be faster.

--no-ignore
: Don't respect ignore files (.gitignore, .rgignore, etc.)
: Don't respect ignore files (.gitignore, .ignore, etc.)
This implies --no-ignore-parent.

--no-ignore-parent
Expand Down
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Less common options:
Never use memory maps, even when they might be faster.
--no-ignore
Don't respect ignore files (.gitignore, .rgignore, etc.)
Don't respect ignore files (.gitignore, .ignore, etc.)
This implies --no-ignore-parent.
--no-ignore-parent
Expand Down
2 changes: 1 addition & 1 deletion src/gitignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The motivation for this submodule is performance and portability:
2. We could shell out to a `git` sub-command like ls-files or status, but it
seems better to not rely on the existence of external programs for a search
tool. Besides, we need to implement this logic anyway to support things like
an .rgignore file.
an .ignore file.
The key implementation detail here is that a single gitignore file is compiled
into a single RegexSet, which can be used to report which globs match a
Expand Down
3 changes: 2 additions & 1 deletion src/ignore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ whether a *single* file path should be searched or not.
In general, there are two ways to ignore a particular file:
1. Specify an ignore rule in some "global" configuration, such as a
$HOME/.rgignore or on the command line.
$HOME/.ignore or on the command line.
2. A specific ignore file (like .gitignore) found during directory traversal.
The `IgnoreDir` type handles ignore patterns for any one particular directory
Expand All @@ -24,6 +24,7 @@ use types::Types;

const IGNORE_NAMES: &'static [&'static str] = &[
".gitignore",
".ignore",
".rgignore",
];

Expand Down
5 changes: 5 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ sherlock!(ignore_git, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.assert_err(&mut cmd);
});

sherlock!(ignore_generic, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.create(".ignore", "sherlock\n");
wd.assert_err(&mut cmd);
});

sherlock!(ignore_ripgrep, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
wd.create(".rgignore", "sherlock\n");
wd.assert_err(&mut cmd);
Expand Down

0 comments on commit 46a34f5

Please sign in to comment.