Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

Patchbot Examples

Example patches for Patchbot - ready to use, customize, or learn from.

Each patch directory contains a patch script and a commit message template. Copy a patch into your own Patchbot project and adjust it to your needs.

Patches

PatchTypeDescription
find-and-replaceShellGeneric find-and-replace across files (URLs, class names, config values)
add-editorconfigPHPAdd an .editorconfig file for consistent coding styles
add-gitattributesPHPAdd .gitattributes with export-ignore rules for smaller Composer packages
add-php-packageShellAdd a Composer package to composer.json
update-php-cs-fixer-rulesPHPAdd or update a rule in .php-cs-fixer.php
replace-copyright-yearShellReplace copyright year strings across all files
rename-vendor-nameShellRename a vendor/company name and PHP namespace
rename-fileShellRename a file
remove-deprecated-filesShellRemove deprecated CI config files

Usage

Import

# Create a skeleton project if you don't have one yet
composer create-project pixelbrackets/patchbot-skeleton my-patches
# Import all patches
./vendor/bin/patchbot import https://github.com/pixelbrackets/patchbot-examples
# Import a single patch only by path
./vendor/bin/patchbot import https://github.com/pixelbrackets/patchbot-examples --path=patches/add-editorconfig

Customize

Each patch has configurable values at the top of the script (package names, file paths, search strings). Edit them before running the patch.

All patches are idempotent - they skip gracefully when the change was already applied.

See the Patchbot walkthrough for a guide on creating and testing patches.

Apply

# Apply a patch to a single repository
./vendor/bin/patchbot patch add-editorconfig git@gitlab.com:user/repo.git

Read the full guides on applying patches to a selected repository or across many repositories in batch mode.

License

GNU General Public License version 2 or later

Author

Dan Kleine (@pixelbrackets)

About

Example patch scripts ready to use with Patchbot

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages