Skip to content

--ignore-file fails to follow symlinks #3030

Open
@ssbarnea

Description

@ssbarnea

Please tick this box to confirm you have reviewed the above.

  • I have a different issue.

What version of ripgrep are you using?

ripgrep 14.1.1

features:+pcre2
simd(compile):+NEON
simd(runtime):+NEON

How did you install ripgrep?

brew

What operating system are you using ripgrep on?

macos

Describe your bug.

It seems that --ignore-file=valid-symlink-to-file generates a runtime error instead of loading the symlinked file:

rg: tags:: IO error for operation on tags:: No such file or directory (os error 2)

This is problematic for users trying to use dotfiles with something like stow which uses symlinks to track config files with git. ripgrep was the first tool I found that seems to not be symlink friendly

What are the steps to reproduce the behavior?

Create symlink to the ignore file and pass it via --ignore-file

What is the actual behavior?

rg: tags:: IO error for operation on tags:: No such file or directory (os error 2)

What is the expected behavior?

Read symlinks ignore files if they resolve and exit with error if they do not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAn issue that is lacking clarity on one or more points.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions