git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: BUG?: git-apply sometimes says "corrupt patch" when adding single lines

From
Tor Arvid Lund <torarvid@gmail.com>
Date
Aug 18, 2010, 09:15 UTC
Message-ID
<AANLkTimSnKxMpYZ263muV4nE-ppfWXfpM6SEo4HKAB66@mail.gmail.com>
In-Reply-To
<4C6B8BC8.9050301@viscovery.net>
On Wed, Aug 18, 2010 at 9:29 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 16 quoted lines
> 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-
Previous: Johannes Sixt
Message 5 of 5 in “BUG?: git-apply sometimes says "corrupt patch" when adding single lines”
  1. Tor Arvid LundAug 17, 2010
  2. Jonathan NiederAug 17, 2010
  3. Tor Arvid LundAug 18, 2010
  4. Johannes SixtAug 18, 2010
  5. Tor Arvid LundAug 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.