git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Imre Deak" <imre.deak@gmail.com>
To: git@vger.kernel.org
Subject: git apply: git diff header lacks filename information for git diff --no-index patch
Date: Thu, 2 Oct 2008 21:27:36 +0300	[thread overview]
Message-ID: <500f3d130810021127j570bb540p901f6a73f58a6cb1@mail.gmail.com> (raw)

Hi,

I have the following problem:

$ echo -e '\x0' > a
$ git diff --no-index --binary /dev/null a > patch
$ rm a
$ git apply patch
fatal: git diff header lacks filename information (line 4)
$ cat patch
diff --git a/dev/null b/a
new file mode 100644
index 0000000000000000000000000000000000000000..1f2a4f5ef3df7f7456d91c961da36fc58904f2f1
GIT binary patch
literal 2
JcmZSJ0ssIE01E&B

literal 0
HcmV?d00001

The same works for text based patches:

$ echo 1 > a
$ git diff --no-index /dev/null a > patch
$ rm a
$ git apply patch
$ ls
a
$ cat patch
diff --git a/dev/null b/a
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/a
@@ -0,0 +1 @@
+1

The binary patch lacks ---/+++ lines but still provides the name info
on the diff --git line which I think should suffice for git apply.

--Imre

             reply	other threads:[~2008-10-02 18:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 18:27 Imre Deak [this message]
2008-10-04  4:17 ` git apply: git diff header lacks filename information for git diff --no-index patch Jeff King
2008-10-04  8:28   ` Jakub Narebski
2008-10-05 19:19     ` Jeff King
2008-10-04 16:54   ` Linus Torvalds
2008-10-04 17:08     ` Linus Torvalds
2008-10-04 17:48       ` Linus Torvalds
2008-10-05 19:21         ` Jeff King
2008-10-05 19:17     ` Jeff King
2008-10-05 19:24       ` Jeff King

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=500f3d130810021127j570bb540p901f6a73f58a6cb1@mail.gmail.com \
    --to=imre.deak@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).