Re: git grep failure?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 19, 2026, 17:24 UTC
- Message-ID
- <xmqqtsublolr.fsf@gitster.g>
- In-Reply-To
- <7e8159fb-f7ff-41f0-8955-5ed2dd5dc7fe@infradead.org>
Randy Dunlap <rdunlap@infradead.org> 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.