#408 Patch for Windows

brian Wed 3 Dec 2008

Does anyone have a recommendation for a patch program to apply a unified diff to a file which works on Windows?

I tried GNU patch which just barfs with:

Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

helium Wed 3 Dec 2008

On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option --binary is given.

Seems like this assertion moved from line 343 to line 354.

brian Wed 3 Dec 2008

I saw that surfing around Google for help, but my line endings were all Unix. Regardless, crashing on an invalid file instead of reporting an error seems pretty lame. Ideally I'd like a program which doesn't care newline style.

katox Wed 3 Dec 2008

Have you tried that under msys or cygwin? I remember I had gnu patch working normally under one of those (don't remember which of them though).

cheeser Wed 3 Dec 2008

There's also diffmerge that comes highly recommended. http://www.sourcegear.com/diffmerge/ I haven't used it personally as I tend to just use the merge stuff in IDEA.

Login or Signup to reply.