-
-
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
Do not ignore hidden files that are tracked by git. #340
Comments
Could you please provide a test case and describe expected output versus actual output? |
outputs
so, as far as I can see, there is no way to have normalfile and .hiddenfile but not ignoredfile. |
I don't see your expected output anywhere. What do you expect to see? |
I don't understand. Why doesn't |
My expected output was some flag that would return |
Docs can definitely be clearer. I'll mark this as a doc bug. Thank you. :-) |
Ah, but I noticed that
outputs
but the contents of |
It's working as intended. --hidden removes the hidden filter and therefore
shows the .git directory. If you want to ignore it, then add it to an
.ignore file.
…On Jan 24, 2017 2:24 AM, "Antony Lee" ***@***.***> wrote:
Ah, but I noticed that --hidden includes .git in the search:
#!/bin/sh
git init /tmp/tmprepo
cd /tmp/tmprepo
rg --hidden Unnamed
outputs
Initialized empty Git repository in /tmp/tmprepo/.git/
.git/description
1:Unnamed repository; edit this file 'description' to name the repository.
.git/hooks/update.sample
55:"Unnamed repository"* | "")
but the contents of .git should probably be ignored unless some number of
-u is passed? (Not sure what makes the most sense here.)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#340 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb34mvqwuqRjT-lyKKYEc8BdvfJ2LMuks5rVac4gaJpZM4Lqr_f>
.
|
Obviously no flag: search all nonbinary, nonhidden files that are tracked by git -uu seems equivalent to -u --hidden, by the way. I don't know how much you care about backcompat, but if you want the flags to be orthogonal to each other perhaps you can remove -uuu and let the new -uu correspond to the old -uuu (as the old -uu is covered by -u --hidden). |
But that's not what it means.
Yes. The
This seems to be the core of your suggestion. Unfortunately, ripgrep doesn't operate based on what's tracked in git, but rather, what's in your gitignore files. Therefore, it is inherently imperfect. The intended solution here is to either whitelist specific hidden files that you want searched, or to pass |
Ah, I see, rg operates in a world where there is no knowledge of git, but there just happens to be already written .ignore files that are called ".gitignore". I guess that's fine (especially as I can .ignore .git/ from my $HOME as you suggest), just a bit... unexpected, at least for me. |
I came across this exact issue while trying to come up with a solid set of flags to use with |
@bdarfler |
Thanks, I wasn't being as clear as I could have been. I just wanted to point out that this seems to be a common use case and it might be nice to have a flag for it. However, there is an easy enough workaround. Thanks for the awesome tool! |
@bdarfler Fair enough. There are two other possibilities. One is to create an alias, e.g.,
and then use |
Cool! My primary use case is for |
Sorry to bring this back up, but just to add that I'm in the |
@tombh Right. Especially if this is a config knob inside of some vim plugin somewhere. Having to use |
Let me just add that I had exactly the same expectation as @anntzer: I expected That I solved it by creating a
That makes |
So, I came up with the following configuration in my
This allows me to open and search through hidden files, even if they are in But then I set an ignore file which has Works like a charm! Thank you, @BurntSushi! |
- FZF_DEFAULT_COMMAND: fzf コマンド押下時の動作(デフォルトは find) - FZF_CTRL_T_COMMAND: <C-t> コマンド押下時の動作(ファイル名補完) find を rg(ripgrep) コマンドに置き換える。 --files: ファイルリストを出力 --hidden: 隠しファイル対象 --follow: シンボリックリンクは実態まで追う --glob '!.git': (隠しファイルは対象にするが).git 配下は無視する refs. [fzfによるCUI生活の改善](https://blog.nijohando.jp/post/fzf-fish-vim/) refs. //github.com/BurntSushi/ripgrep/issues/340#issuecomment-280868119
It looks like neither of
-u
,-uu
, and-uuu
allow "search exactly the files that git is tracking, including the hidden ones" (i.e.,git grep
). If this is correct, could you consider adding this possibility?Thanks in advance.
The text was updated successfully, but these errors were encountered: