Has anyone found a good "patch" for Windows XP?

lekei - May 29, 2005 - 06:05

OK, first.... please no lectures on why command line is better than GUI. I went through my radical anti-GUI (who needs a mouse anyway) days back in the '80s. Oh, and yes, I know what Cygwin is -- I even have it on another one of my computers...

Has anyone found a good Windows program that reads patch files and applies them to files on Windows?

I have wasted half a day trying to find one because I am trying to install the taxonomy_access module and much to my horror, it requires applying a patch to another module.

I found this really nice, deceptively named "winmerge" which is great for making diffs but doesn't merge.

So I have installed gnu patch for now, but I dislike programs that need command line options to work properly. It's a great way to destroy the universe at 4:28 am with a typo.

Cygwin?

bomarmonk - May 29, 2005 - 06:27

After messing around with a few other choices, cygwin worked for me. It does use a unix/command line interface, but I actually find that pretty direct. Although, it doesn't employ a pretty point-and-click interface.

Geez

bomarmonk - February 26, 2008 - 21:46

I just realized, three years later, that you didn't want to hear about Cygwin. Some help I was! Sorry about that.

maybe?

sepeck - May 29, 2005 - 10:02

http://www.tortoisecvs.org/

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

Thanks, I am using Tortoise cvs

lekei - May 30, 2005 - 00:57

I am using Tortoise cvs, it does not apply patch files.

Patch by hand.

vwX - May 29, 2005 - 11:58

Patch by hand. The +++ get added and the --- get removed.

Go Open Source!

Pewter Tankard - May 29, 2005 - 12:25

Try the following (no guarantees... I don't use them myself but they look good):

http://gnuwin32.sourceforge.net/packages/patch.htm
http://unxutils.sourceforge.net/

Hope this helps

I have installed gnu patch

lekei - May 30, 2005 - 01:24

I have installed the gnu version of patch. You still have to type filenames.

If I must use command line then I must. If I had a problem with open source then I wouldn't be using Drupal. Unfortunately, I thought it (open source) meant that you could become familiar with the source code, not that it was an absolute requirement to get it to work.

I give up. I could type 1000 filenames in the time it has taken me to find a way not to. Even if I did it wrong 1% of the time and it took me 15 minutes to undo the damage each time I think I would still be ahead.

Solution under Windows

lekei - June 2, 2005 - 04:00

After a bit of fiddling, I found that the way to get patches to install is to use the form:

patch {file} {patch} --verbose --binary

Without --binary, you get the most useful and informative message: "assertion failed" message due to the fact that the drupal files are in UNIX format.

Additionally, to upload the edited files successfully, you should add the Drupal file extensions .patch, .module, and .theme to the list of text file types in your FTP program, so it can repair newlines when it sends them to *nix hosts.

Thank you!

marcushenningsen - June 22, 2009 - 00:15

Thank you!

Set up an association for one-click patching

Steven - June 2, 2005 - 04:35

Really, I'm sympathetic with you... I also think that the Unix command-line is one the biggest propagations of idiocy of the modern age, but applying a patch with the patch tool requires one command that is relatively easy to remember:

patch -p0 < file.patch

If you want, you can turn this into one-click patching with a little trick. Get the native win32 version of patch.exe from the gnu tools, copy it to a directory within the system PATH. Then create a patch.bat file in the same location, with the following content:

@echo off
patch -p0 < %1
pause

Finally, set up a file type association for .patch and .diff files which executes:

patch.bat "%1"

From now on when you need to apply a patch, copy the patch file to the right location and double-click it. Or if you want, you can set up the default action to open the patch in a text-editor, with "Apply Patch" being a non-default right-click action.

With some tweaking, you can turn Windows into a very productive environment ;).

--
If you have a problem, please search before posting a question.

Duh

lekei - June 2, 2005 - 10:04

Now you see what happens when you are stuck on one way of thinking... I was ticked off because they made patch a win32 application, so you can't set it's command line parameters.

cygwin probs

msz3544 - July 18, 2005 - 04:08

I have installed cygwin and put the .module and .patch file in its directory. when i open the program and type anything that begins with "patch" it tells me "bash: patch: command not found" what do i do??? thanks

In all likelihood, you

bonobo - July 18, 2005 - 05:47

didn't install the "patch" command when you installed Cygwin. In the install process, you are given a list of options to install -- I forget exactly where it is located (it's been a while since I installed cygwin) but I think it's located in "Developer Tools".

I hope this takes care of it.

Cheers,

Bonobo

thanks for the tip

manerhabe - February 26, 2008 - 03:46

After fixing the "assertion failed" error (details at http://drupal.org/node/60116), this worked great. Thanks!

Thanks for the great tip Steve! (All those years ago!)

plinky - July 18, 2008 - 20:23

I put the ".BAT" file in /SYSTEM32 with the following lines:

@echo off
patch -p0 < %1 --verbose --binary
pause

Now I can just double click on ".PATCH" files.

Easy Peasy! :)

Thanks again!

You can also create .patch files just as easily..

aaron1234nz - December 2, 2008 - 10:27

You can also create .patch files just as easily..
1. Download and install diff from the GNUWin32 Project http://gnuwin32.sourceforge.net/packages/diffutils.htm

2. Navigate to the place that the exe's were installed (eg. C:\Program Files\GnuWin32\bin)

3. Create a new file called diff.bat and put the following code in the file:

@echo off
"C:\Program Files\GnuWin32\bin\diff.exe" -u %1 %2 > %1.patch
pause

4. Go to the Start menu->Run and type "sendto"
5. Create a shortcut of diff.bat in this folder
6. You can now create a diff file by selecting both the original and modified file with your mouse, right click ON THE ORIGINAL file and choose diff.bat. A new .patch file will be created.

Try a full featured IDE

Alan D. - December 2, 2008 - 10:47

I've had a number of IDE's that can handle patches. Eclipse is one such example, and works a treat.

Alan Davison
www.caignwebs.com.au

Any other?

kenorb - April 1, 2009 - 10:42

I'm using Eclipse/Aptana only for patching, but it crashing very often, so I'm sick if I need to run it only for patching.
WinMerge/SVNTortoise to apply patches based on SVN repositories, but CVSTortoise doesn't have any patch utils (like in SVN version) and even just on filesystem it's not working quite well.
Ported Patch version doesn't work on Vista (it's asking for a permission, but it popup additional window ignoring console arguments).
You can try with admin console, but often it's crashing or making: Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354, so you need to convert your patches into CR-LF, so it making more complicated.
Manually you can change small patches, but not more complicated, so it not make sense.
Any other simpler sugestions? I'm interested with patching, not making a patch.

working on 7

hoobuba - November 1, 2009 - 08:16

Install the package aaron1234nz mentioned.

I run command

patch -i foo.patch --verbose --binary

I have just patched the gmap module this way

 
 

Drupal is a registered trademark of Dries Buytaert.