Change the FIXME on line 38 to the name of your remote, then put the script in your /usr/local/sbin.
-
Get onto a clean branch (e.g. master, or 4.6, or 4.7.15-rc)
-
Make some changes to files. When done, type:
gitpr "CRM-12345 - Fix foo and bar"
The script will automatically:
- Run civilint and abort if there are style errors
- Create a branch named CRM-12345
- Make a commit with the message "CRM-12345 - Fix foo and bar"
- Push to your fork and set the upstream so you can easily push more changes
- Open a pull request against the correct branch of civicrm
If you are working on a bigger PR and want to make several commits before submitting it, do it the normal way and then use this script at the end. For example:
- Do
git checkout -b CRM-12345
to manually create your branch - Make one or more commits
- When your work is complete, type gitpr "CRM-12345 - Fix foo and bar"
If there are any unstaged changes the script will commit them before submitting the PR.
By default this script makes the first word of your commit message into the branch name. This works well for messages like gitpr "CRM-12345 - Fix foo and bar"
. If you want to specify a different branch name, type it before the message:
gitpr fooBar "Fix foo and bar"