Context: I'm using a static checker to verify files in my working tree. I want to check all files in the current directory except those that would be ignored by git (object files for instance), including those that were not yet added to the repository. I also want to exclude files that are known to git but were deleted locally.
I think the best way to achieve that would be by using
find . -type f -exec <some git command that filters the input with git ignore>
...or by using git-ls
with some option, or by using git show --porcelain