Hi Ben, > Date: 2026-11-06 12:34:20-0500 > From: Ben Knoble > [...] > > Hmmm, that could work. Thanks! > > > > $ git ls-files --format='%(objectmode) %(path)' \ > > | grep -v ^120000 \ > > | sed 's/^.* //' \ > > | grep '\.[ch]$' \ > > | xargs grepc creat; > > > > With -z it becomes a bit tedious: > > > > $ git ls-files -z --format='%(objectmode) %(path)' \ > > | grep -zv ^120000 \ > > | sed -z 's/^.* //' \ > > | grep -z '\.[ch]$' \ > > | xargs -0 grepc creat; > > The filtering for C files can also be done by Git, I believe: > > git ls-files … '*.[ch]' I prefer regexes over globs; they're more powerful, and they're hot in brain memory. :) > > But, indeed, I don't care about files with spaces often, because I don't > > create them in my stuff. > > > > I expect git-ls-files(1) could make this much simpler, though: > > > > $ git ls-files --type f \ > > | grep '\.[ch]$' \ > > | xargs grepc creat; > > I believe the expression is “patches [scratching your own itch are] welcome” ;) Nice! If the idea is welcome, I can certainly work on a patch. :) Have a lovely night! Alex --