I believed that git grep shows the lack of Unix’s composability. It could be git + grep, but git grep is written in C and simply has a grep-equivalent inside.

But there is a caveat. In September 2005, Linus Torvalds has added git grep, 20-lines shell script. So, it was git + xargs + grep in the beginning! Then, in April 2006, Junio C Hamano has added a C version of git grep to reduce Git’s dependence on the shell.

This attempts to set up built-in “git grep” to further reduce our dependence on the shell, while at the same time optionally allowing to run grep against object database.


But this is going in the right direction. The shell script version is one of the worst Portability offender in the git barebone Porcelainish; it uses xargs -0 to pass paths around and shell arrays to sift flags and parameters.

So, it was actually showing Unix’s composability in the beginning, and later replaced due to the lack of portability.