Skip to content

Add git-grep threads param

Victor Leschuk git 8 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 3 repliesIn review
  2. v71 patch 2 repliesSuperseded
  3. v61 patch 7 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v51 patch1 replySuperseded
v41 patch18 repliesSuperseded
v31 patch6 repliesSuperseded
v21 patch1 replySuperseded
v11 patch3 repliesSuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Introduce grep threads paramDocumentation/config.txt Documentation/git-grep.txt builtin/grep.c +1 more+51 -153 replies
2/2Get rid of online_cpus() when determining grep threads numbuiltin/grep.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 0/2] Add git-grep threads param

Introducing v8 of git-grep threads param patch.
Patch is now split in 2 parts - 1/2 is actually renewed v6 version (see list of changes below), 2/2 removes dependency on online_cpus() - as we discussed with Eric this is rather significant change in default behavior and should be placed into separate patch.

Here is list of changes since v6 ($gmane/281160):

* Fixed broken t7811: moved all threads_num setup to 1 place (for -O option it was in wrong place)
* Fixed 'invalid number of threads' message so that it could be translated
* Got rid of grep_threads_config() - its too trivial to be separate function
* Fixed xcalloc() args (sizeof(pthread_t) -> sizeof(*threads)) to correspond to general git style
* Improved commit message (in 2/2) to explain why online_cpus() is now not used in threads_num setup
* The full param documentation was moved into single place (grep.threads description in git-grep.txt) and is referenced from other places. Also made few language improvements in documentation.
* Style improvements: splitted too long lines

Victor Leschuk (2):
"git grep" can now be configured (or told from the command line)
how many threads to use when searching in the working tree files.
Number of threads now doesn't depend on online_cpus(), e.g. if
specific number is not configured GREP_NUM_THREADS_DEFAULT (8) threads will be used even on 1-core CPU.

 Documentation/config.txt               |  4 +++
 Documentation/git-grep.txt             | 12 +++++++++
 builtin/grep.c                         | 49 +++++++++++++++++++++++-----------
 contrib/completion/git-completion.bash |  1 +
 4 files changed, 51 insertions(+), 15 deletions(-)
Signature · 1 line
2.6.3.369.g3e7f205.dirty