1 | # Hophop
|
2 | ![](https://img.shields.io/npm/v/@buildo/hophop.svg)
|
3 |
|
4 | A minimal tool to accelerate the GitHub workflow from the command line.
|
5 |
|
6 | ## Installation
|
7 |
|
8 | `npm install -g @buildo/hophop` with a non-ancient version of `npm`
|
9 |
|
10 | ## Config
|
11 |
|
12 | #### GitHub
|
13 |
|
14 | `hophop gh setup` to set the GitHub API access token
|
15 |
|
16 | ##### For GitHub Enterprise repos
|
17 |
|
18 | 1. add `.hophoprc` file in repo root folder with a valid "apiUrl" key (ex: `https://my.custom.url/api/v3`)
|
19 | 2. run `hophop gh setup` as usual from inside the repo
|
20 |
|
21 | #### Toggl
|
22 |
|
23 | `hophop toggl setup` to set the Toggl API access token
|
24 |
|
25 | `hophop toggl install-hooks` to install the toggl git hooks
|
26 |
|
27 | ## GitHub Workflow
|
28 |
|
29 | `hophop gh feature` to create a local branch referencing an open issue (or, optionally, create a new issue on the fly).
|
30 |
|
31 | `hophop gh pr` to push the current feature branch and, if needed, open a Pull Request. The name of the pull request will cause GH to auto-close the issue when the PR is merged.
|
32 |
|
33 | `hophop gh commit` to create a commit that closes an open issue.
|
34 |
|
35 | `hophop gh open` to open on Chrome the PR associated with current branch (if it exists and if it's open).
|
36 |
|
37 | ## Toggl
|
38 |
|
39 | `hophop toggl start` to start a time entry for an issue (only while on a branch)
|
40 |
|
41 | `hophop toggl misc` to start a generic time entry titled 'miscellaneous'
|
42 |
|
43 | `hophop toggl test` to start a time entry titled 'test'
|
44 |
|
45 | `hophop toggl stop` to stop the current time entry
|
46 |
|
47 | ## .hophoprc
|
48 | add an optional `.hophoprc` file in your project root folder in order to use default answers to the `hophop gh feature` task questions:
|
49 |
|
50 | #### example
|
51 | ```
|
52 | toggl: n // or `no`, or `nope`
|
53 | branchPrefix: n
|
54 | branchSuffix: y // or `yes`, or `yep`, or `si`, or `of course`, or `youbetcha`
|
55 | ```
|
56 |
|
57 | ## zsh autocompletion
|
58 | After installing the package, an autocompletion file is available at
|
59 | ```
|
60 | NPM_PREFIX/lib/node_modules/@buildo/hophop/_hophop
|
61 | ```
|
62 |
|
63 | where `NPM_PREFIX` is usually `/usr/local` and it can be retrieved using `npm prefix -g`
|
64 |
|
65 | #### Installation using oh-my-zsh
|
66 | If you use [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), installing the autocompletion is as easy as:
|
67 | ```bash
|
68 | mkdir -p ~/.oh-my-zsh/custom/plugins/hophop
|
69 | ln -s `(npm prefix -g)`/lib/node_modules/@buildo/hophop/_hophop _hophop
|
70 | ```
|
71 |
|
72 | Then enable the plugin in your `.zshrc`, for example:
|
73 | ```bash
|
74 | plugins=(git brew hophop)
|
75 | ```
|