Skip to content
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

Documentation and differentiation of --no-ignore-vcs and --no-ignore #354

Closed
Tracked by #695
HaleTom opened this issue Nov 3, 2018 · 5 comments · Fixed by #826
Closed
Tracked by #695

Documentation and differentiation of --no-ignore-vcs and --no-ignore #354

HaleTom opened this issue Nov 3, 2018 · 5 comments · Fixed by #826
Milestone

Comments

@HaleTom
Copy link

HaleTom commented Nov 3, 2018

The man page says:

       -I, --no-ignore
              Do not respect files like .gitignore and .fdignore and include ignored files in the search results.

       --no-ignore-vcs
              Do not respect version control ignore files like .gitignore and include the respective entries in the search results.
  1. Where is the list of files like... that are normally respected? (The wording makes me wonder if there are other files ending in ignore which are usually looked at)
  2. Is -I a strict superset of --no-ignore-vcs?
@HaleTom HaleTom changed the title Documentation and differentiation between --no-ignore-vcs and --no-ignore Documentation and differentiation of --no-ignore-vcs and --no-ignore Nov 3, 2018
@sharkdp
Copy link
Owner

sharkdp commented Nov 4, 2018

Thank you very much for your feedback. This topic definitely needs some clarification.

  • Where is the list of files like... that are normally respected? (The wording makes me wonder if there are other files ending in ignore which are usually looked at)

There are six sources for ignore patterns:

  1. .gitignore files
  2. .git/info/exclude files (these are like user-specific .gitignore files that are not shared with the rest of the world)
  3. The global gitignore configuration (core.excludesFile git setting, defaults to $HOME/.config/git/ignore)
  4. .ignore files (things you would like to ignore across tools like fd, ripgrep, ag, etc. that are not part of your .gitignore)
  5. .fdignore files (things you would only like to be ignored by fd)
  6. Manually added ignore patterns via --exclude <pattern> or --ignore-file <path> (things you would only like to be ignored in this specific run of fd)

The --no-ignore option switches off 1-5.
The --no-ignore-vcs option switches off 1-3.

2. Is -I a strict superset of --no-ignore-vcs?

Yes.


Sources:

@calebcordry
Copy link

calebcordry commented Nov 20, 2018

I am not sure how common of a use case it is, but personally I would like the ability to turn on 1. and turn off 2.. (I want to respect my projects .gitignore, but I have my own scratchpad type files I would like to index, but never commit).

Is this possible with the current API? Is there something like an --include that I am missing?

@calebcordry
Copy link

I found the --no-ignore flag, but it "no ignores" everything, it would be cool to be able to specify certain paths to --no-ignore like you can with the --ignore-path flag.

BTW: Thanks for the awesome tool!!! 😁

@tmccombs
Copy link
Collaborator

Not a perfect solution. But as a workaround, you could use an ignore file (either .fdignore or with --ignore-path) that explicitly includes your scratchpad files.

@calebcordry
Copy link

calebcordry commented Nov 21, 2018

@tmccombs oooh this actually works well for my use case. fd --no-ignore --ignore-file=.gitignore Thanks for the help! 👍

@sharkdp sharkdp mentioned this issue Dec 6, 2020
13 tasks
@sharkdp sharkdp added this to the fd 9 milestone Aug 8, 2021
tmccombs added a commit that referenced this issue Aug 10, 2021
Explicitly list which files are used for gitignore.

Fixes #354
sharkdp pushed a commit that referenced this issue Aug 15, 2021
Explicitly list which files are used for gitignore.

Fixes #354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants