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

[RFC PATCH 0/3] grep: submodule support

From
Chris Packham <judge.packham@gmail.com>
Date
Sep 29, 2010, 20:28 UTC
Message-ID
<1285792134-26339-1-git-send-email-judge.packham@gmail.com>

This patch series is my initial attempt to add submodule awareness to git grep. It's also the first time I've played with the git C code so expect bugs. The patches are based off apply on Jens Lehmann's 'enhance_git_for_submodules' branch in git://github.com/jlehmann/git-submod-enhancements.git

The first patch adds some basic tests for grep with submodules. There is probably some overlap with other grep tests so I'll have a more in-depth look at what is needed later. I have a problem with the tests that when I invoke 'git grep' using run_command I actually end up using the installed git which doesn't understand my new --submodule-prefix option.

The 2nd patch just adds a --submodule-prefix option so that I can prepend some text to the output from the sub processes.

The 3rd patch is the main implementation. Currently I rebuild a command line for the subprocess based on the opts structure and I make use of the modified argv[0] from the command. Neither of these are really optimal, it'd be much easier if I could just start my subprocess from cmd_grep (or even grep_cache). Any pointers to get me moving in this direction are welcome. Even if I retain the rebuilding of the command line I'd like to rebuild the pattern(s) instead of relying on the saved_argv[0].

Chris Packham (3):
      add test for git grep --recursive
      grep: prepare grep for submodules
      grep: add support for grepping in submodules
Next: Chris Packham
Message 1 of 22 in “grep: submodule support”
  1. 0/3 grep: submodule supportChris Packham, Sep 29, 2010
  2. 1/3 add test for git grep --recursiveChris Packham, Sep 29, 2010
  3. Ævar Arnfjörð BjarmasonSep 29, 2010
  4. Chris PackhamSep 29, 2010
  5. Kevin BallardSep 29, 2010
  6. 2/3 grep: prepare grep for submodulesChris Packham, Sep 29, 2010
  7. Nguyen Thai Ngoc DuySep 30, 2010
  8. Chris PackhamSep 30, 2010
  9. Nguyen Thai Ngoc DuyOct 1, 2010
  10. Chris PackhamOct 1, 2010
  11. 3/3 grep: add support for grepping in submodulesChris Packham, Sep 29, 2010
  12. Jens LehmannSep 29, 2010
  13. Junio C HamanoSep 29, 2010
  14. Chris PackhamSep 29, 2010
  15. Jens LehmannSep 30, 2010
  16. Johannes SixtSep 30, 2010
  17. Jens LehmannSep 30, 2010
  18. Chris PackhamSep 29, 2010
  19. Jens LehmannSep 30, 2010
  20. Chris PackhamSep 30, 2010
  21. Heiko VoigtSep 30, 2010
  22. Jens LehmannSep 30, 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.