git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pico Geyer <pico@xiplink.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Using git am -p 2 with binary patches
Date: Mon, 31 May 2010 17:59:29 +0200	[thread overview]
Message-ID: <4C03DCE1.2000201@xiplink.com> (raw)

Hi all.

I've been trying to apply a set of patches from one repository to a completely independent repository (no shared history).
Since the paths are different, I'm applying the patches with git am -p 2
I noticed that whenever my patches contain binary files, git-am fails to apply the patch.

Here's a simple test case:
mkdir gittmp
cd gittmp
git init
mkdir subdir
echo "abcdefghijklmnop" > blah.txt
tar -czf subdir/binfile.tgz blah.txt
git add subdir/binfile.tgz
git commit -m "Added binary file"
git format-patch --root HEAD
git am -p 2 0001-Added-binary-file.patch

And the output that I get is:
Applying: Added binary file
fatal: git diff header lacks filename information when removing 2 leading pathname components (line 9)
Patch failed at 0001 Added binary file
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Is this a bug in git-am or git-apply?
Or is there a good reason why this doesn't work?

I'm using the latest git version (1.7.1)

Thanks in advance.
Pico

                 reply	other threads:[~2010-05-31 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4C03DCE1.2000201@xiplink.com \
    --to=pico@xiplink.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).