How to make patch files to contribute to contributed modules

By Benjamin Melançon
on 28 Oct
1 comment

Key words and phrases

create patches for drupal modules run diff drupal make a patch

Tags

Description

These instructions assume a GNU-Linux, Mac OS X, or other UNIX-y computing environment.

Follow these instructions for using CVS:

http://drupal.org/patch/create

However, if you are making a patch for a contributed module rather than Drupal core, going to the Drupal root directory doesn't make sense.

For a change to a single file (not adding or removing a file), you can just make a copy of the original file, call your new file _original and list the file you change (the one without a rename in this case) second in the diff command.

And create the actual patch from within the module directory:

diff -up token_node_original.inc token_node.inc > token_5_reroll.patch

Update: see recommended patch naming conventions!

 

For going the other way, see
Posted by Benjamin Melançon on Sun, 2007-10-28 16:24
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.