From: Jens Lehmann Date: Thu, 30 Sep 2010 15:07:05 GMT Subject: Re: [RFC PATCH 3/3] grep: add support for grepping in submodules Message-ID: <4CA4A799.2060302@web.de> In-Reply-To: <4CA47478.6030207@viscovery.net> Am 30.09.2010 13:28, schrieb Johannes Sixt: > Am 9/30/2010 0:59, schrieb Junio C Hamano: >> A few more things to think about. >> >> 1. What does this mean: >> >> $ git grep --recursive -e frotz master next >> >> It recurses into the submodule commits recorded in 'master' and 'next' >> commits in the superproject, right? > > And what does it mean if you add --cached? Does it grep in the index of > the submodules, or does it grep in the rev of the submodule that is > recorded in the index of the supermodule? Hmm, as you told grep to use the index of the superproject it should use the rev of the submodule that is recorded in the index of the superproject. Thus the "--cached" should be removed from and the appropriate rev must be added to the arguments of the grep forked in the submodule.