git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maarten Billemont <lhunath@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: git-am cannot apply git format-patch -M
Date: Mon, 28 Mar 2011 09:44:34 +0200	[thread overview]
Message-ID: <09D72CB4-1B48-4799-B0D5-DB54942D840F@gmail.com> (raw)

I've created a series of patches for my local commits using:

git format-patch -M -C ...

The resulting patch files contain hunks like:

diff --git a/file1 b/file2
similarity index 93% 
rename from file1
rename to file2
index 7cf3a09..88c9c13 100644
--- a/file1
+++ b/file2
[...]

git-am fails at applying these hunks, failing with:

Applying: [commit description]
fatal: git apply: bad git-diff - inconsistent old filename on line 109
Patch failed at [HEAD commit]
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".

Additionally, I'd like to report that the line number reported by git-am in this error message does not reflect the actual line number of the problem in the patch file.  The reported line number is offset by -[amount of lines before the [---] line in the patch file], which makes understanding the error message hard, confusing and potentially misleading.

             reply	other threads:[~2011-03-28  7:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28  7:44 Maarten Billemont [this message]
2011-03-28 12:14 ` git-am cannot apply git format-patch -M 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=09D72CB4-1B48-4799-B0D5-DB54942D840F@gmail.com \
    --to=lhunath@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).