git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git apply-diff / am cannot deal with patches generated with git diff/format-patch --noprefix?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 10, 2011, 22:32 UTC
Message-ID
<7vfwl8sxrz.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4E43053C.5080407@gmx.net>
marcel partap <mpartap@gmx.net> writes:
> ...at least it seems so. -p0 does not help:
>> fatal: git apply: bad git-diff - inconsistent old filename on line xx
Hmm, does not reproduce for me.

$ git checkout v1.7.6 ;# or whatever random commit I had at hand $ git show --no-prefix >P.diff $ grep "^diff --git" P.diff

diff --git Documentation/RelNotes/1.7.6.txt Documentation/RelNotes/1.7.6.txt
diff --git Documentation/git.txt Documentation/git.txt
diff --git GIT-VERSION-GEN GIT-VERSION-GEN
$ git checkout HEAD^
$ git apply -p0 <P.diff
$ git diff v1.7.6 ; echo nothing
nothing
$ git diff --stat
 Documentation/RelNotes/1.7.6.txt |    8 +-------
 Documentation/git.txt            |    5 +++++
 GIT-VERSION-GEN                  |    2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)
Previous: marcel partap
Message 2 of 2 in “git apply-diff / am cannot deal with patches generated with git diff/format-patch --noprefix?”
  1. marcel partapAug 10, 2011
  2. Junio C HamanoAug 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.