public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Jeff King <peff@peff.net>,  git@vger.kernel.org
Subject: Re: git grep failure?
Date: Wed, 18 Mar 2026 22:16:40 -0700	[thread overview]
Message-ID: <xmqq7br8o0uf.fsf@gitster.g> (raw)
In-Reply-To: <2c943182-d5d7-4f72-ab97-8d07bf4ed216@infradead.org> (Randy Dunlap's message of "Wed, 18 Mar 2026 21:42:23 -0700")

Randy Dunlap <rdunlap@infradead.org> writes:

> On 3/18/26 5:38 PM, Jeff King wrote:
>> On Wed, Mar 18, 2026 at 04:28:17PM -0700, Randy Dunlap wrote:
>> 
>>> If I apply the patch at
>>> https://lore.kernel.org/linux-doc/c5bb61cf789df1ecb32facc29df9749987c7ddfc.1773346620.git.ljs@kernel.org/
>>>
>>> Subject: [PATCH 02/15] mm: add documentation for the mmap_prepare file operation callback
>>>
>>> to the Linux kernel tree (e.g., linux-next-20260316), it applies cleanly.
>>>
>>> I noticed a typo in the patch ("struct vma_area_desc" should be
>>> "struct vm_area_desc"). When I run
>>> $ git grep vma_area_desc
>>> the output is empty.
>>>
>>> Is this expected? (but not by me :)
>> 
>> I applied the patch and git-grep does produce one line of output (the
>> instance added by the patch).
>> 
>> Two possible differences:
>> 
>>   - are you sure the patch application succeeded?
>
> 'git apply filename.patch' succeeded AFAICT. git status shows one
> untracked file (the one that is added by the patch).
> Do I need to do 'git commit' also?

"git apply filename.patch" or "git apply --index filename.patch"?
The former will leave the new file unknown to "git", so "git grep"
would not look into it.

>>   - are you in a different subdirectory? By default git-grep narrows its
>>     search to your current working directory and its subdirectories. So
>>     if you are in arch/ or something, it would not find the result in
>>     Documentation/. You can do:
>> 
>>       git grep vma_area_desc :/
>> 
>>     to search from the root of the project.
>
> I'm running 'git grep' from the top-level directory of the
> kernel source tree.
>
> thanks.

  reply	other threads:[~2026-03-19  5:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 23:28 git grep failure? Randy Dunlap
2026-03-19  0:38 ` Jeff King
2026-03-19  4:42   ` Randy Dunlap
2026-03-19  5:16     ` Junio C Hamano [this message]
2026-03-19 15:53     ` Jeff King
2026-03-19 16:47       ` Randy Dunlap
2026-03-19 17:24         ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2019-08-21  3:32 Wayne Walker
2019-08-21  4:04 ` Wayne Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7br8o0uf.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox