Creating and Applying Patches

(Submitted Mon, 2006-09-18 22:27)

I regularly find myself digging up the proper nodes to explain to someone on the forums how to apply a patch either from a shell command line or locally on a windows machine.

I also find myself always needing to dig up the information on the proper command line syntax for generating a patch for submission.

So here's the scoop, so I don't have to do all that oh-so-complicated searching everytime ;)

Creating a patch:
diff -uF^function old.module new.module > file.patch

More info available at http://drupal.org/diffanpatch

Applying a patch from shell:
patch old.module < file.patch
(I find that the -p option is rarely needed)

Applying a patch on a local windows box to upload via FTP:
Discussion of various means here

Submitted by Thomas Reitz (not verified) on Tue, 2009-01-20 03:27.

"A wonderful article you posted. That is so informatory and creative. Please keep these excellent posts coming. You helped me so much.

Thanks for sharing!"

Submitted by anniuty (not verified) on Tue, 2009-03-17 04:55.

Under what situation/condition would you use the -p value?

Submitted by Anonymous (not verified) on Sat, 2009-04-25 05:30.

Yaling Jewelry engaged to provide china jewelry wholesale ,we have a good factory in China, make us to be China Jewelry Suppiler and China Jewelry Manufacturer ,we have large china jewelry market base in Yiwu city,all of our items base on small moq jewelry wholesale , our china jewelry factory is located in Yiwu, the biggest commodity city in China. We have abundant products on show in clued fashion jewelry wholesale, Amber jewelry, Crystal Jewelry, Silver Jewelry, Bead Jewelry,Hair Accessory, Korean Jewelry, Warmly welcome customers all over the world come and cooperation for mutual benefit.

Submitted by Lava Lamps (not verified) on Thu, 2009-04-30 02:45.

Thanks a lot my friend, the article you posted was of great help. I have to congratulate you as this would surely be of great help to many more people. Keep up the good work my friend.

Submitted by Anonymous (not verified) on Thu, 2009-05-07 01:47.
Submitted by articles (not verified) on Fri, 2009-05-08 07:55.

Very nice article. I Liked ur efforts.

Submitted by Creation internet (not verified) on Mon, 2009-05-11 22:49.

Hello,

I'm looking for freelance developer or web designer.

I install website and I need someone to add functions to some site.

If you are interested thank you kindly send us a resume by mail.

Submitted by lisa (not verified) on Tue, 2009-05-12 18:14.

the article you posted was of great help
Thanks for sharing!

Submitted by jordan shoes (not verified) on Wed, 2009-05-13 10:37.

A pair of jordan shoes or ugg boots? I think you prefer air jordan shoes cos a pair of basketball shoes can help you much in the match. However, someone may saying like this: hey, give me some

Submitted by Online payday advance (not verified) on Sat, 2009-05-16 00:59.

I really enjoyed your article thank you so much for posting it.

Submitted by cash advance online (not verified) on Thu, 2009-05-21 14:45.

great blog thanks sharing.

Submitted by Prestito (not verified) on Mon, 2009-05-25 05:57.

You guys are really doing a great job with this website! All the changes and updates are really great. Keep up the good work!

Submitted by zack (not verified) on Sat, 2009-07-11 11:18.

I'm looking for freelance developer or web designer.

I install website and I need someone to add functions to some site.

If you are interested thank you kindly send us a resume by mail.

Submitted by cooking games (not verified) on Mon, 2009-05-25 18:12.

Nice article. Thank you so much!

Submitted by salliserp (not verified) on Fri, 2009-06-12 05:16.

The article was very informative. You were able to provide the necessary and basic concepts of Patch that can make even the beginners understand and get interested in trying it out. Good job!

Submitted by http://webhostingrating.com (not verified) on Fri, 2009-06-12 08:31.

Although there were a lot of information given, these were all utilized to better comprehend the definition of Patches. From the sample images/codes to the comprehendible instructions, these brought about the effectiveness of the whole article.

Submitted by women's scarves (not verified) on Wed, 2009-06-17 15:21.

Is it possible to use Drupal on a wordpress blog?

Submitted by Free Ads (not verified) on Thu, 2009-06-25 01:38.

Hmm...surprisingly simple command that saves a lot of time.

Submitted by gambling security (not verified) on Thu, 2009-06-25 19:15.

You were able to provide the necessary and basic concepts of Patch that can make even the beginners understand and get interested in trying it out. Good job!

Submitted by silver charms (not verified) on Thu, 2009-07-02 02:13.

i love using drupal. It definitely makes great websites.

Submitted by Mens Rings (not verified) on Thu, 2009-07-02 05:04.

Im not too sure how you would really enjoy something if it doesn't talk about much. But thats fine.

Submitted by Rare Names (not verified) on Tue, 2009-07-07 10:28.

I’m currently switching over to drupal and getting my hands on all the information I could find (this is how I came across your blog). Very informative, thanks.

Submitted by Lucy (not verified) on Sun, 2009-07-19 08:58.

Thanks a lot my friend, the article you posted was of great help. I have to congratulate you as this would surely be of great help to many more people.

Hosted By Dreamhost.com