Ilias Apostolou <ilias.apostolou.zero@xxxxxxxxx> writes: > The reason we need to list all of the true files (except submodules) > is for code refactoring using the sed unility, for example: > > git ls-files | grep -Ev '(png$|ico$)' | xargs sed -i 's/\r\n/\n/' > ... > In my opinion, this should be a feature for "ls-files" only, since it > would be nice to have a clean stream of true files. Ah, then pathspec is still the right tool to use, I would think. For example, git ls-files -s ':(exclude)*.png' ':(exclude)*.ico' | sed -n -e 's/^100[76][54][54] [0-9a-f]* 0 //p' | xargs sed -i 's/\r\n/\n/' that is, (1) ls-files -s can be used to learn what kind of path it is. Regular files are either 100644 or 100755. That way, you can also exclude symbolic links, which your example use case would probably not want to touch. And you can filter the output to have 'a clean stream of true files' fairly easily Depending on the details of your needs, it can be tweaked into 'a clean stream of executable files' etc., too. (2) pathspec magic like ':(exclude)' can be used to lose your "we know png and ico are not text files". Hope this helps.