Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Add inferFromCommitTitle option to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Garant committed Jul 26, 2018
1 parent 17696ea commit f404a60
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 31 deletions.
65 changes: 35 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ gh jira
### 1. Create

Option | Usage | Type
--- | --- | ---
`-N`, `--new` | **Required** | `Boolean`
`-p`, `--project` | **Required** | `String`
`-t`, `--title` | **Required** | `String`
`-A`, `--assignee` | *Optional* | `String`
`-C`, `--component`| *Optional* | `String`
`-m`, `--message` | *Optional* | `String`
`-P`, `--priority` | *Optional* | `String`
`-R`, `--reporter` | *Optional* | `String`
`-T`, `--type` | *Optional* | `String`
`-v`, `--version` | *Optional* | `String`
| Option | Usage | Type |
| ------------------- | ------------ | --------- |
| `-N`, `--new` | **Required** | `Boolean` |
| `-p`, `--project` | **Required** | `String` |
| `-t`, `--title` | **Required** | `String` |
| `-A`, `--assignee` | *Optional* | `String` |
| `-C`, `--component` | *Optional* | `String` |
| `-m`, `--message` | *Optional* | `String` |
| `-P`, `--priority` | *Optional* | `String` |
| `-R`, `--reporter` | *Optional* | `String` |
| `-T`, `--type` | *Optional* | `String` |
| `-v`, `--version` | *Optional* | `String` |

#### Examples

Expand Down Expand Up @@ -67,10 +67,10 @@ Option | Usage | Type

### 2. Comment

Option | Usage | Type
--- | --- | ---
`-c`, `--comment`| **Required** | `String`
`-n`, `--number` | **Required** | `Number`
| Option | Usage | Type |
| ----------------- | ------------ | -------- |
| `-c`, `--comment` | **Required** | `String` |
| `-n`, `--number` | **Required** | `Number` |

Omitting `--number` will guess issue number from the last commit message.

Expand All @@ -84,12 +84,17 @@ Omitting `--number` will guess issue number from the last commit message.

### 3. Open in Browser

Option | Usage | Type
--- | --- | ---
`-B`, `--browser` | **Required** | `Boolean`
`-n`, `--number` | **Required** | `Number`
| Option | Usage | Type |
| ----------------- | ------------ | --------- |
| `-B`, `--browser` | **Required** | `Boolean` |
| `-n`, `--number` | **Required** | `Number` |

Omitting `--number` will guess issue number from the last commit message.
* Omitting `--number` will guess issue number from the last commit message.
* If you would prefer to use the branch as the ticket number you can change this setting in `gh-plugin.json`:

```json
"inferFromCommitTitle": false,
```

#### Examples

Expand All @@ -101,12 +106,12 @@ Omitting `--number` will guess issue number from the last commit message.

### 4. Transition

Option | Usage | Type
--- | --- | ---
`--transition` | **Required** | `String`
`-n`, `--number` | **Required** | `Number`
`-A`, `--assignee` | *Optional* | `String`
`-m`, `--message` | *Optional* | `String`
| Option | Usage | Type |
| ------------------ | ------------ | -------- |
| `--transition` | **Required** | `String` |
| `-n`, `--number` | **Required** | `Number` |
| `-A`, `--assignee` | *Optional* | `String` |
| `-m`, `--message` | *Optional* | `String` |

Omitting `--number` will guess issue number from the last commit message.

Expand Down Expand Up @@ -140,9 +145,9 @@ Both Jira and GitHub usernames are supported `--assignee` values.

### 5. Status

Option | Usage | Type
--- | --- | ---
`--status` | **Required** | `String`
| Option | Usage | Type |
| ---------- | ------------ | -------- |
| `--status` | **Required** | `String` |

#### Examples

Expand Down
2 changes: 1 addition & 1 deletion bin/jira.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Jira {

// If number was not found yet, use only the first commit message to
// try to infer the issue number.
if (!issue) {
if (!issue || config.plugins.jira.inferFromCommitTitle) {
issue = this.getIssueNumberFromText(git.getCommitMessage(branch, 1));
}

Expand Down
1 change: 1 addition & 0 deletions gh-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"password": "",
"port": "",
"protocol": "https",
"inferFromCommitTitle": true,
"transition": {
"Close Issue": {
"Fix Version/s": true
Expand Down

0 comments on commit f404a60

Please sign in to comment.