Skip to content

warning about commondir on ripgrep over git repo with submodules #1520

@Roguelazer

Description

@Roguelazer

What version of ripgrep are you using?

$ rg --version
ripgrep 12.0.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

Also,

$ git --version
git version 2.25.1

How did you install ripgrep?

Homebrew

What operating system are you using ripgrep on?

macOS. Also seems to occur on Linux.

Describe your question, feature request, or bug.

When running ripgrep on a git clone with submodules, it prints the following error:

 $ rg -i foobar
../../../../.git/modules/path/to/submodule/commondir: No such file or directory (os error 2)

I suspect this is related to #1446

If this is a bug, what are the steps to reproduce the behavior?

git init foo
git init bar
cd foo
touch file
git add file
git commit -m 'initial commit'
cd ../bar
touch file
git add file
git commit -m 'initial commit'
git submodule add ../foo path
rg string

If this is a bug, what is the actual behavior?

The ripgrep invocation will print

../.git/modules/path/commondir: No such file or directory (os error 2)

If this is a bug, what is the expected behavior?

No warnings. Never warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions