Skip to content

Absolute path glob patterns on windows #530

Open
@roblourens

Description

@roblourens

If I do a search like this:

C:\> rg -g "!C:/foo/bar/**" search "C:\foo\"

Then the -g glob is not excluded. I have to write it like -g "!/foo/bar". I think this is expected because globs starting with / should be matched as relative from the cwd. However, if I'm searching across drives,

C:\> rg -g "!Z:/foo/bar/**" search "Z:\foo\"

then the exclude glob is applied. I think this is correct too because !/foo/bar would match something in C:, not Z:.

But if that works, then is there a reason that -g "!C:/foo/bar/**" can't also be applied when C:\ is the cwd, just for consistency?

My particular case is searching folders across multiple drives simultaneously, and processing glob patterns to be applied to those different folders, and not wanting to special-case C:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug.iceboxA feature that is recognized as possibly desirable, but is unlikely to implemented any time soon.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