If I run a git grep
command n times, I get errors about 0.8 * n times.
$ git grep foo_bar_search `git rev-list HEAD` -- dir/subdir >/dev/null
fatal: unable to read tree (bc9e3369c6d6f027075e794fa11db02af3f8fb38)
$ git grep foo_bar_search `git rev-list HEAD` -- dir/subdir >/dev/null
fatal: unable to read tree (473a47dd3895b1db09baf4cf9463f4cbd224d5dd)
$ git grep foo_bar_search `git rev-list HEAD` -- dir/subdir >/dev/null
$ git grep foo_bar_search `git rev-list HEAD` -- dir/subdir >/dev/null
fatal: unable to read tree (b917adbfffd1928c8f6ac0f746a4fdfcf2088029)
$ git grep foo_bar_search `git rev-list HEAD` -- dir/subdir >/dev/null
fatal: unable to read tree (473a47dd3895b1db09baf4cf9463f4cbd224d5dd)
What I've tried
git fsck
reports nothing bad just a couple of dangling objectsgit grep
shows the same behavior in the clone again.git cat-file
, seem to be all fineThe most interesting Google hit was:
http://www.spinics.net/lists/git/msg164520.html
The message was just 3 hours old. Well, if they have race conditions in git grep
, that could explain everything. So do they do search in parallel on several cores? (I have 4 here.) How could I disable that, short of booting the whole machine with only 1 core?
$ git --version
git version 1.7.3.4
(That's what came with OpenSUSE 11.4)
It looks like any of the following conditions will disable threads in git-grep:
-O
is given to open the matching files in a pager.NO_PTHREADS
is defined at compile time.-p
is given to show the function name as context.Hopefully, the last one of these will be unobtrusive to your workflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With