BurntSushi / ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore
The Unlicense
48.97k stars 2.01k forks source link

Support for extended file attributes and the xdg.robots recommendation. #2936

Closed blueforesticarus closed 6 days ago

blueforesticarus commented 6 days ago

Most filesystems support extended attributes. Tooling around this feature is lacking, despite great potential for organizing files.

Two examples:

  1. We'd like to be able to set an attribute on folders to get ripgrep to skip them.
  2. We'd like to be able to set metadata like user.role=notes on files, and tell ripgrep to only search them.

See: https://github.com/sharkdp/fd/issues/830#issuecomment-2492367688

Freedesktop recommends user.xdg.robots.index https://www.freedesktop.org/wiki/CommonExtendedAttributes/

BurntSushi commented 6 days ago

I basically agree with sharkdp that this should be left to an external tool. There's a reason why tooling doesn't usually support attributes like this: it's expensive. ripgrep does a lot of its filtering without doing any stat calls on each file.

The main way to tell ripgrep to skip things is with a .gitignore, .ignore or .rgignore file.