██╗███████╗██████╗ ██████╗ ██╗ ██╗
██║██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝
██║█████╗ ██████╔╝██████╔╝ ╚████╔╝
██ ██║██╔══╝ ██╔══██╗██╔══██╗ ╚██╔╝
╚█████╔╝███████╗██║ ██║██║ ██║ ██║
╚════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
Your friendly helper to the world of gitflow on jira!
DISCLAIMER: Jerry is a small command-line tool used to aid my day-to-day workflow using jira and github. I'm not sure how useful it will be for anyone else not working the same way.
Clone this repo locally:
git clone https://github.com/robhurring/jerry.git
Install dependencies:
`npm install`
Install the package:
`npm link`
Configuring:
Run the command `jerry` to run the setup wizard.
A few things to note:
- This uses Jira's OnDemand login since I do not have an oauth application setup.
- If GitHub is giving you validation issues, make sure to go into application settings and remove and old
Jerry CLItokens. - This makes a lot of assumptions. You can edit some of these in the
~/.jerry.jsonconfig file after running the setup wizard. - If you ask jerry about tickets without the project prefix he will prefix the
config.defaultProjectin front of it before looking it up.
The branch command will take a TICKET_ID param and create a named branch for you in your current repo.
- --preview, -p Show what the generated branch name would be.
- --copy, -c Copy the generated branch name to the clipboard.
$ jerry branch PL-4
$ Switched to branch PL-4_some_truncated_ticket_summary_here
NOTE: Jerry will also scan your existing local branches to see if there is already a branch made starting with the ticket pl-4 (case insensitive). If it finds something matching the given ticket, it will check out the existing branch rather than creating a new one. This should avoid some annoying collision issues.
Print some basic information about a given ticket. If not ticket is passed in through the args list jerry will check your current branch and extract the ticket from there.
$ jerry info pl-4
PL-4: Some ticket title here.
https://company.atlassian.net/browse/PL-4
Creator: Rob Hurring
Assigned: Nobody
Code Reviewer: Nobody
Status: New
Hey developer, theres awful bugs all over. Fix them, then go get some
ice cream or something
Or if you are in a git repo and on a feature branch
$ git checkout -b PL-4_some_feature_branch
$ jerry info
PL-4: Some ticket title here.
https://company.atlassian.net/browse/PL-4
Creator: Rob Hurring
Assigned: Nobody
Code Reviewer: Nobody
Status: New
Hey developer, theres awful bugs all over. Fix them, then go get some
ice cream or something
If you are on a feature branch Jerry can help you open a fleshed-out pull-request. If you are the lazy-type, this is really the best feature.
Jerry will detect the ticket from your branch name, lookup some basic details about the ticket from Jira and use that info to build out a pull-request. If all goes well, it will open a browser window to your new PR so you can do some adjustments.
- --base=BRANCH This will set the base of the pull-request to
BRANCH. It will be yourconfig.defaultBranchotherwise - --remote=REMOTE This will set the remote of the pull-request to
REMOTE. It will be yourconfig.defaultRemoteotherwise - --preview Preview what will be the title and body of the pull-request.
$ git checkout -b PL-4
$ jerry pull-request
PL-4: Some awesome feature request here
https://github.com/user/repo/pulls/1
NOTE: This is still a work-in-progress and is a little bit flaky right now.
Open the given ticket in the browser. Jerry will extract the ticket ID from the feature branch if possible and no ID was given in the args.
$ jerry open pl-4
http://company.atlassian.net/browse/PL-4
Copy the given ticket to the clipboard. Jerry will extract the ticket ID from the feature branch if possible and no ID was given in the args.
$ jerry cp pl-4
Copied! http://company.atlassian.net/browse/PL-4
- Fork it ( https://github.com/robhurring/jerry/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request