From: Jonathan Nieder <jrnieder@gmail.com>
To: Tor Arvid Lund <torarvid@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: BUG?: git-apply sometimes says "corrupt patch" when adding single lines
Date: Tue, 17 Aug 2010 18:43:14 -0500 [thread overview]
Message-ID: <20100817234314.GK2221@burratino> (raw)
In-Reply-To: <AANLkTineHiG9vCpbJzJ2x9CFjZ7LQeExs7cN5YhoZhft@mail.gmail.com>
Tor Arvid Lund wrote:
> I don't really know the git-gui code or the git C code well, but it
> seems that I got around the error with this small patch:
>
> diff --git a/builtin/apply.c b/builtin/apply.c
> index 12ef9ea..124791f 100644
> --- a/builtin/apply.c
> +++ b/builtin/apply.c
> @@ -1335,6 +1335,8 @@ static int parse_fragment(char *line, unsigned long size,
> * l10n of "\ No newline..." is at least that long.
> */
> case '\\':
> + if (newlines == oldlines == 1)
[...]
Heh. This code is a roundabout way to say "if (newlines == oldlines)",
rather than "if (newlines == 1 && oldlines == 1)" that might have been
intended.
Unfortunately I do not have any more insight than that. If you can
give an example reproducing this with git apply from the command
line, that would be very helpful.
Thanks,
Jonathan
next prev parent reply other threads:[~2010-08-17 23:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 23:27 BUG?: git-apply sometimes says "corrupt patch" when adding single lines Tor Arvid Lund
2010-08-17 23:43 ` Jonathan Nieder [this message]
2010-08-18 1:37 ` Tor Arvid Lund
2010-08-18 7:29 ` Johannes Sixt
2010-08-18 9:15 ` Tor Arvid Lund
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=20100817234314.GK2221@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=torarvid@gmail.com \
/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).