Subject: Re: git grep failure?

From: Junio C Hamano <[email-masked]>
Date: Thu, 19 Mar 2026 10:24:00 -0700

Randy Dunlap <[email-masked]> writes:

> (/me notes that git am and git apply are different in this regard.)

Yup, consider that "git apply" without "--index" is a mere "make
goodness invented for Git available outside Git, as a replacement
for 'patch'", just like "git diff --no-index" is a mere "make
goodness invented for git-diff available outside Git, as a
replacement for 'diff'".  Their primary value is that they work
outside the context of Git without relying on a Git repository, but
they have limitations for not relying on a Git repository and data.

There are better alternatives (i.e., "apply" with "--index", or
"am"; "diff" without "--no-index") if you are working with Git.