-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(ignore) Use .gitignore
for Sapling repositories
#2374
Comments
This was discussed a bit here: #2364 Namely, I talk about why your (1) idea is processor not a good idea right now, and also suggest a work around that I don't see in your list of alternatives. |
Thank you 😊
|
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit makes `--ignore-vcs` always respect all gitignore files. This behaves similarly to the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁
|
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit makes `--ignore-vcs` always respect all gitignore files. This behaves similarly to the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable similar to `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) This commit also contains an unrelated wording fix to CONTRIBUTING.md Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
Describe your feature request
Sapling is a source control tool that is compatible with git repositories. For example , when working on ripgrep I use
sl clone [email protected]:BurntSushi/ripgrep.git
. Sapling puts its files (including the wrapped.git
directory) in<repo>/.sl
. However, since theignore
crate only ignores.gitignore
files when it detects a.git
directory (#1229), usingrg
inside a Sapling repo ends up returning a bunch of unwanted results.Possible solutions
.gitignore
files when.git
or.sl
directories are detectedrg --ignore-file .gitignore
fd
and other tools usingignore
ignore
into thinking I'm using regular git, maybe by making an empty.git
directoryAdd flag--treat-as-git
to tell ripgrep to use.gitignore
files--no-require-git
is thisI prefer solution 1. Would you accept a patch that checks for
.git
or.sl
when deciding if you're in a git repo?The text was updated successfully, but these errors were encountered: