git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 0/2] submodule aware grep

From
Chris Packham <judge.packham@gmail.com>
Date
Sep 24, 2010, 16:07 UTC
Message-ID
<4C9CCCCC.4000909@gmail.com>
In-Reply-To
<20100924134748.GA576@book.hvoigt.net>
On 24/09/10 06:47, Heiko Voigt wrote:
Show 23 quoted lines
> Hi,
> 
> On Thu, Sep 23, 2010 at 02:17:05PM -0700, Chris Packham wrote:
>> This series contains 2 RFC patches that both implement a grep feature for
>> submodules.  The first patch is a self-contained script for contrib that should
>> work with most current git versions. The 2nd is basically the same
>> implementation but done as a proper git submodule command with some of the
>> helper code moved to git-sh-setup.sh
>>
>> There are a couple of questions for this. Technically I'm making submodule 
>> grep-aware, should I be making grep submodule-aware instead? I haven't looked 
>> at the grep code yet but I imagine its harder.
> 
> Nice work! IMO it would be even nicer to have it as part of git grep.
> Have a look at Jens branch about submodule checkout:
> 
> http://github.com/jlehmann/git-submod-enhancements (enhance_git_for_submodules)
> 
> particularly how checkout_submodule() is implemented. It forks a git
> checkout inside the submodule. In a similar way you could fork a grep
> there. Then you just have to teach the forked grep to prepend the
> submodules path.
> 

I'll look into it, from following Jens code it doesn't look too hard (like you say just fork and pass a text prefix). I'm currently doing my git hacking on my main development machine so I should probably setup and environment where I can hack without affecting $dayjob work.

In the meantime I've got an updated patch for contrib if anyone is interested (it just adds some grep options to be passed through).

Thanks, Chris

Previous: Heiko VoigtNext: Jens Lehmann
Message 5 of 6 in “submodule aware grep”
  1. 0/2 submodule aware grepChris Packham, Sep 23, 2010
  2. 1/2 contrib: add git-submodule-grep.shChris Packham, Sep 23, 2010
  3. 2/2 submodule: add grep commandChris Packham, Sep 23, 2010
  4. Heiko VoigtSep 24, 2010
  5. Chris PackhamSep 24, 2010
  6. Jens LehmannSep 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.