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

git grep failure?

From
WWWayne Walker <lwaynewalker@gmail.com>
Date
Aug 21, 2019, 03:32 UTC
Message-ID
<CAJCsJ5fygkaB-=EoYC3EJ3HrBbGUW+cdsXTddUUEyBzT1TB+Zg@mail.gmail.com>

I use git grep constantly. Today it failed for me. It isn't looking at all the files for some reason. Am I somehow missing something?

midsizeschools@ut:~/tams (master u= origin/master)$ git ls-files | wc
    254     254   10062
midsizeschools@ut:~/tams (master u= origin/master)$ git grep -l . | wc
    250     250    9938
midsizeschools@ut:~/tams (master % u= origin/master)$ git grep -l . |
sort > b
midsizeschools@ut:~/tams (master % u= origin/master)$ git ls-files |
sort > a
midsizeschools@ut:~/tams (master % u= origin/master)$ diff a b
26,27d25
< app/models/tars_attendee.rb
< app/models/tars_district_registration.rb
144d141
< nbproject/private/config.properties
156d152
< public/favicon.ico

# git knows about the file: ~/tams (master u= origin/master)$ git ls-files | grep app/models/tars_district_registration.rb app/models/tars_district_registration.rb

# the string is found by grep in the file: ~/tams (master u= origin/master)$ grep accepts_nested_attributes_for app/models/tars_district_registration.rb accepts_nested_attributes_for :tars_attendees, :allow_destroy => false, :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }

# but git grep doesn't find the file???? ~/tams (master u= origin/master)$ git grep accepts_nested_attributes_for ~/tams (master u= origin/master)$

# git version is reasonably new - not my server, can't upgrade it ~/tams (master u= origin/master)$ git --version git version 2.19.2

-- Wayne Walker lwaynewalker@gmail.com

Next: Wayne Walker
Message 1 of 2 in “git grep failure?”
  1. Wayne WalkerAug 21, 2019
  2. Wayne WalkerAug 21, 2019

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.