Last active
May 23, 2017 15:10
-
-
Save HokieGeek/b4d0899057a2303c3338b797fc07cd46 to your computer and use it in GitHub Desktop.
Recursive git grep for my old version of git at work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
${cmd:="git --no-pager grep "$@} | |
[ "`readlink --canonicalize $PWD`" == "`git rev-parse --show-toplevel`" ] && \ | |
git submodule --quiet foreach --recursive \ | |
"${cmd} | awk -v path=\$path '{ print path, \$0 }' OFS='/' || :" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment