From: Jeff King <peff@peff•net>
To: Randy Dunlap <rdunlap@infradead•org>
Cc: git@vger•kernel.org
Subject: Re: git grep failure?
Date: Thu, 19 Mar 2026 11:53:26 -0400 [thread overview]
Message-ID: <20260319155326.GA3611913@coredump.intra.peff.net> (raw)
In-Reply-To: <2c943182-d5d7-4f72-ab97-8d07bf4ed216@infradead.org>
On Wed, Mar 18, 2026 at 09:42:23PM -0700, Randy Dunlap wrote:
> > 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?
Ah, I see. I used "git am" to apply the patch, which made a commit using
the email as the commit message.
As Junio noted, "git apply" by itself will not mark the file as tracked.
You would need to "git add" it, at which point git-grep would start
looking at it (since it only looks at tracked files). And then "git
commit" if you actually want a commit.
But at that point, you probably want to be using "git am", unless you
don't want to use the sender's commit message for some reason. (Though
even if that is the case, I'd probably use "git am" and then "git commit
--amend" to tweak it).
-Peff
next prev parent reply other threads:[~2026-03-19 15:53 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
2026-03-19 15:53 ` Jeff King [this message]
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=20260319155326.GA3611913@coredump.intra.peff.net \
--to=peff@peff$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
--cc=rdunlap@infradead$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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