From: Randy Dunlap Date: Thu, 19 Mar 2026 16:47:24 GMT Subject: Re: git grep failure? Message-ID: <7e8159fb-f7ff-41f0-8955-5ed2dd5dc7fe@infradead.org> In-Reply-To: <20260319155326.GA3611913@coredump.intra.peff.net> On 3/19/26 8:53 AM, Jeff King wrote: > 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). OK, thanks to you and Junio for explaining. Just a User Error. (/me notes that git am and git apply are different in this regard.) -- ~Randy