Patch your develop-wordpress directory like a boss (also works on other trac based projects)
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-patch-wordpress --save-devOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-patch-wordpress');patch_wordpress{
tracUrl: 'core.trac.wordpress.org'
}-
Have a diff or a patch file in your working Directory, then run
grunt patch. If multiple files are found, you'll be asked which one to apply. -
Enter a ticket number, e.g.
grunt patch:15705
- Enter a ticket url, e.g.
grunt patch:https://core.trac.wordpress.org/ticket/15705
- Enter a patch url, e.g.
grunt patch:https://core.trac.wordpress.org/attachment/ticket/11817/13711.diff
- Enter a github url that points to a changeset such as a Pull Request, e.g.
grunt patch:https://github.com/aaronjorbin/develop.wordpress/pull/23
After you've made changes to your local WordPress develop repository, you can upload a patch file directly to a Trac ticket. e.g. given the ticket number is 2907,
grunt upload_patch:2907In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- 0.1.0 - Initial Release
- 0.1.1 - Fix bug when only one diff|patch exists in the working directory
- 0.1.2 - Update wording of instructions
- 0.2.0 - Add support for patches generated in more ways. Improve UX by outputing results all the time
- 0.3.0 - Only keep diff when debug flag is passed. Default to selecting newest patch. Make more files patchable. Allow input during patching process incase the shell prompts the user
- 0.4.0 - add upload_patch, add support for github urls
- 0.4.1 - Remove Mocha as a peerdendency
- 0.4.2 - set
cmd-difftodifffor svn
