If you find yourself needing to look for a certain pattern among all sources files in Jenkins and its plugins - anything in https://github.com/jenkinsci - try cloning http://git.jenkins-ci.org/all.git and then running this handy one-liner in it (replace the "basic"-syntax regexp with whatever you need):

git branch -a | xargs git grep 'SomeClass\.staticMethod' | perl -n -e 'print "$repo/$fname: $text\n" if ($repo, $fname, $text) = /^remotes\/origin\/(.+)\/master:([^:]+):(?:[ \t]*)(.+)$/'

(This greps files as of the tip of the master branch only. Checking historical 
versions is much slower.)

Reply via email to