summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2016-12-16 19:03:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-22 19:47:33 (GMT)
commit0281e487fd913bd9a32a710f3109ff3002f3e4a9 (patch)
tree3b5b3bda83044726df670a446bbf6764d2cde6da /tree-diff.c
parent4538eef564c81c96f2874ccadc54d3c69cc0e19c (diff)
downloadgit-0281e487fd913bd9a32a710f3109ff3002f3e4a9.zip
git-0281e487fd913bd9a32a710f3109ff3002f3e4a9.tar.gz
git-0281e487fd913bd9a32a710f3109ff3002f3e4a9.tar.bz2
grep: optionally recurse into submodules
Allow grep to recognize submodules and recursively search for patterns in each submodule. This is done by forking off a process to recursively call grep on each submodule. The top level --super-prefix option is used to pass a path to the submodule which can in turn be used to prepend to output or in pathspec matching logic. Recursion only occurs for submodules which have been initialized and checked out by the parent project. If a submodule hasn't been initialized and checked out it is simply skipped. In order to support the existing multi-threading infrastructure in grep, output from each child process is captured in a strbuf so that it can be later printed to the console in an ordered fashion. To limit the number of theads that are created, each child process has half the number of threads as its parents (minimum of 1), otherwise we potentailly have a fork-bomb. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-diff.c')
0 files changed, 0 insertions, 0 deletions