I'd like to search all git tracked files that 1. has an .hs file extension and 2. contain the word import in any lines.
I've tried to use git ls-files -z | xargs -0 rg -g '*.hs' "import" however unfortunately if you pass an explicit list of files to rg it seems to ignore the -g glob flag.
I could potentially use grep to use some regex lookbehind to extract files with a specific file extension, or potentially filter the output from git ls-files -z (ensuring we keep the null separated filenames aspect, both approaches seem a bit clunky though...
If anyone has any ideas.