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

Allow exclude/ignore by absolute path #1272

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cyqsimon
Copy link
Contributor

@cyqsimon cyqsimon commented Mar 2, 2023

Closes #851.

This is a crude implementation of my idea in #851 (comment). I don't think it's ideal (far from it), but at least we have some kind of support for people who want it.

I'll keep it a draft for now. Please chip in your ideas on how this could be improved.

Main sore spots

  • Performance penalty due to path canonicalization (although this is unavoidable)
  • Globs work somewhat differently due to implementation
    • Excluding a directory doesn't cause its children to be excluded too
      • To exclude /foo/bar and all its children, it's necessary to specify a glob of /foo/bar/*
  • The introduction of a separate flag and global ignore file for this purpose
    • --exclude-absolute and ~/.config/fd/ignore-absolute

Todo list

  • Implementation
  • Tests
  • Documentation

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

Successfully merging this pull request may close these issues.

--exclude doesn't work with absolute paths
1 participant