-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix: strip standalone "." directory path #2711
Open
taeruh
wants to merge
1
commit into
BurntSushi:master
Choose a base branch
from
taeruh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem is that in Ignore::matched, the perfix "./" is stripped from files. In Ignore::matched_ignore, the directory path is then stripped from file paths. Now imagine we have a hidden file "./.foo" and pass "." as the search path. "./.foo" gets first stripped to ".foo" and then it would have been stripped to "foo".
1 task
tmccombs
added a commit
to tmccombs/fd
that referenced
this pull request
Mar 14, 2024
This is a workaround for BurntSushi/ripgrep#2711 Fixes: sharkdp#1461
tmccombs
added a commit
to tmccombs/fd
that referenced
this pull request
Mar 14, 2024
This is a workaround for BurntSushi/ripgrep#2711 Fixes: sharkdp#1461
sharkdp
pushed a commit
to sharkdp/fd
that referenced
this pull request
Apr 30, 2024
This is a workaround for BurntSushi/ripgrep#2711 Fixes: #1461
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this pull request
May 6, 2024
v10.0.0 Features - Add `dir` as an alias to `directory` when using `-t` \ `--type`, see #1460 and #1464 (@Ato2207). - Add support for @%s date format in time filters similar to GNU date (seconds since Unix epoch for --older/--newer), see #1493 (@nabellows) - Breaking: No longer automatically ignore `.git` when using `--hidden` with vcs ignore enabled. This reverts the change in v9.0.0. While this feature was often useful, it also broke some existing workflows, and there wasn't a good way to opt out of it. And there isn't really a good way for us to add a way to opt out of it. And you can easily get similar behavior by adding `.git/` to your global fdignore file. See #1457. Bugfixes - Respect NO_COLOR environment variable with `--list-details` option. (#1455) - Fix bug that would cause hidden files to be included despite gitignore rules if search path is "." (#1461, BurntSushi/ripgrep#2711). - aarch64 builds now use 64k page sizes with jemalloc. This fixes issues on some systems, such as ARM Macs that have a larger system page size than the system that the binary was built on. (#1547) - Address [CVE-2024-24576](https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html), by increasing minimum rust version. Changes - Minimum supported rust version is now 1.77.2 On pkgsrc this has been reverted as CVE-2024-24576 only affects Windows.
scottames
pushed a commit
to scottames/dots
that referenced
this pull request
May 17, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [sharkdp/fd](https://github.com/sharkdp/fd) | major | `v9.0.0` -> `v10.1.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>sharkdp/fd (sharkdp/fd)</summary> ### [`v10.1.0`](https://github.com/sharkdp/fd/releases/tag/v10.1.0) [Compare Source](https://github.com/sharkdp/fd/compare/v10.0.0...v10.1.0) #### Features - Allow passing an optional argument to `--strip-cwd-prefix` of "always", "never", or "auto". to force whether the cwd prefix is stripped or not. - Add a `--format` option which allows using a format template for direct ouput similar to the template used for `--exec`. ([#​1043](https://github.com/sharkdp/fd/issues/1043)) #### Bugfixes - Fix aarch64 page size again. This time it should actually work. ([#​1085](https://github.com/sharkdp/fd/issues/1085), [#​1549](https://github.com/sharkdp/fd/issues/1549)) ([@​tavianator](https://github.com/tavianator)) #### Other - aarch64-apple-darwin target added to builds on the release page. Note that this is a tier 2 rust target. ### [`v10.0.0`](https://github.com/sharkdp/fd/blob/HEAD/CHANGELOG.md#v1000) [Compare Source](https://github.com/sharkdp/fd/compare/v9.0.0...v10.0.0) #### Features - Add `dir` as an alias to `directory` when using `-t` \ `--type`, see [#​1460](https://github.com/sharkdp/fd/issues/1460) and [#​1464](https://github.com/sharkdp/fd/issues/1464) ([@​Ato2207](https://github.com/Ato2207)). - Add support for @​%s date format in time filters similar to GNU date (seconds since Unix epoch for --older/--newer), see [#​1493](https://github.com/sharkdp/fd/issues/1493) ([@​nabellows](https://github.com/nabellows)) - Breaking: No longer automatically ignore `.git` when using `--hidden` with vcs ignore enabled. This reverts the change in v9.0.0. While this feature was often useful, it also broke some existing workflows, and there wasn't a good way to opt out of it. And there isn't really a good way for us to add a way to opt out of it. And you can easily get similar behavior by adding `.git/` to your global fdignore file. See [#​1457](https://github.com/sharkdp/fd/issues/1457). #### Bugfixes - Respect NO_COLOR environment variable with `--list-details` option. ([#​1455](https://github.com/sharkdp/fd/issues/1455)) - Fix bug that would cause hidden files to be included despite gitignore rules if search path is "." ([#​1461](https://github.com/sharkdp/fd/issues/1461), [BurntSushi/ripgrep#2711](https://github.com/BurntSushi/ripgrep/issues/2711)). - aarch64 builds now use 64k page sizes with jemalloc. This fixes issues on some systems, such as ARM Macs that have a larger system page size than the system that the binary was built on. ([#​1547](https://github.com/sharkdp/fd/issues/1547)) - Address [CVE-2024-24576](https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html), by increasing minimum rust version. #### Changes - Minimum supported rust version is now 1.77.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone America/Los_Angeles, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/scottames/dots). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem is that in Ignore::matched, the perfix "./" is stripped from files. In Ignore::matched_ignore, the directory path is then stripped from file paths. Now imagine we have a hidden file "./.foo" and pass "." as the search path. "./.foo" gets first stripped to ".foo" and then it would have been stripped to "foo".
I am not completely sure though whether this is the best way to fix it. One could also check earlier whether the directory path is "." and then change it to "./". I don't know which is the best way regarding performance; the current fix is just at the place where it breaks. What do you think?
The implications of this problem (at least the ones I noticed) are that when grepping (including hidden files and passing
.
as search directory) in a subdirectorya/b
ofa
, andb
has a hidden file.foo
, which is ignored in a ignore file ina
, the contents of.foo
are shown.I put in https://github.com/taeruh/debug_file_paths a minimal debugging example to show that.
Issue #829 is similar, but I am not sure about how much it is related.