Jump to content

User:F.trott/Patching Composer-managed extensions on GitHub

From mediawiki.org

First-time Setup

[edit]
  • If the packages were already obtained without specifying the prefer-source flag for composer, delete the "vendor" directory
  • From the MW installation directory:
    • Ensure all packages you want to work on are set to install development versions in composer.json
      • Usually you just specify "dev-master" as package version
    • Install everything from source: composer update --prefer-source
  • Fork the extension on GitHub.com
  • From the extension directory:
    • Add your fork as remote: git remote add fork git@github.com:username/extensionname.git
    • Set your fork as default upstream: git push -u fork

Every time you want to submit a new patch

[edit]
  • From the extension directory:
    • Check out local master branch (if necessary): git checkout master
    • Grab and merge origin remote's master into local: git pull origin master
  • Hack away
  • From the extension directory:
    • Commit changes: git commit -a
    • Push to fork: git push
  • Open a merge request on GitHub.com and hope for the best. Good luck.