git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tor Arvid Lund <torarvid@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git@vger.kernel.org
Subject: Re: BUG?: git-apply sometimes says "corrupt patch" when adding single lines
Date: Wed, 18 Aug 2010 11:15:31 +0200	[thread overview]
Message-ID: <AANLkTimSnKxMpYZ263muV4nE-ppfWXfpM6SEo4HKAB66@mail.gmail.com> (raw)
In-Reply-To: <4C6B8BC8.9050301@viscovery.net>

On Wed, Aug 18, 2010 at 9:29 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 8/18/2010 1:27, schrieb Tor Arvid Lund:
>> I often use git-gui when staging commits, and I noticed that if the
>> file I'm working with has a:
>>
>> \ No newline at end of file
>>
>> ... as the last line of the diff, and I try to "Stage lines for
>> commit", then git-gui (or really git-apply, as I understand it) says
>> that I have a "corrupt patch at line <so-and-so>".
>>
>> Is this a bug? Or is it maybe git-gui that sends something wrong to
>> git-apply? I don't know... :-/
>
> This is really a bug in git-gui, not in git-apply: The big while loop in
> lib/diff.tcl, function apply_range_or_line, must be taught about "\ No
> newline...".

Ok, thanks for tracking it down. I suspected this, since the tests for
git-apply seemed to have example patches for "\ No newline...".
Ultimately, this doesn't scratch me enough that I want to learn (or
guess) how to fix the Tcl stuff...

-Tor Arvid-

      reply	other threads:[~2010-08-18  9:15 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
2010-08-18  1:37   ` Tor Arvid Lund
2010-08-18  7:29 ` Johannes Sixt
2010-08-18  9:15   ` Tor Arvid Lund [this message]

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=AANLkTimSnKxMpYZ263muV4nE-ppfWXfpM6SEo4HKAB66@mail.gmail.com \
    --to=torarvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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).