How can I use pm-update or pm-updatecode for projects that have patches which aren't yet included in a stable release on d.o.? I don't want to have to re-apply the patches (if necessary) to the updated project.
- Site developers can manually keep a list of patches in a patches folder or with patches.txt, but that can't be automated and is prone to errors.
- Building a Drupal site with Git just points users at drush up. Even though a backup of the original project would be saved, I'd still have to manually figure out which projects had patches and re-apply them to the current version of the project.
- A few years ago, #1060500: drush diff [module/core] ? asked about drush up diff functionality and was directed to the Hacked! module. I've used that many times, but only to see what has changed in a site/module. You can't use the Hacked! drush commands to perform the project update.
- Use the Diff Update shell script on pg. 143 of The Definitive Guide to Drupal 7. The script is available here: https://gitorious.org/agaric-scripts/agaric-scripts/blobs/master/version...
I've thought about modifying the Diff Update script for my needs, but I wanted to check first what the drush best practice is for updating patched projects. Thoughts?
Comments
Comment #1
greg.1.anderson commentedThere is no best practice for automating merges. See also #392762: Kitten-o-matic
I would recommend keeping your Drupal site checked in to git. Keep one branch for unpatched modules, and another branch with your patches. Switch to the unpatched branch before running pm-updatecode. Use git tools to merge changes from your old branch into a new fork of the unpatched branch. Throw away old patch branches when you don't need them any more.