git_helper 3.1.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -12
- data/bin/git-helper +9 -13
- data/lib/git_helper/version.rb +1 -1
- data/plugins.zip +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 650688a2378f2653a2b11f27dea56a68008c6a810cb661d25c23c0252230d9d4
|
4
|
+
data.tar.gz: a3a112352ccecf0012d1bcf64ec44a75e91c6696da7c770a4c03b8e05b70bf2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b19fd94cd089417d6ec4da5040856e7d8dca9085cbada3a2db8c2a826f095e9ca497e5da157aa808e2acb4b0810683fddf4ba927ecf0a06b42f987addf7ff91
|
7
|
+
data.tar.gz: d97e0d66c56c5e6e139de4b2da8f2e86e354153c2503becfd6db59ac102a99ecfaae7b93f19af8b26e5417512fec7f64a277933b5bf567a9770b79b58bd25ec7
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ As an additional option, you can set each of the following commands to be a git
|
|
34
34
|
```bash
|
35
35
|
# As a Gem # As a Plugin
|
36
36
|
git-helper clean-branches git clean-branches
|
37
|
-
git-helper code-request
|
37
|
+
git-helper code-request git code-request
|
38
38
|
```
|
39
39
|
|
40
40
|
To do this, download the `plugins.zip` file in the root of this directory. Unzip and place the contents in the appropriate location:
|
@@ -110,25 +110,21 @@ git-helper clean-branches
|
|
110
110
|
|
111
111
|
### `code-request`
|
112
112
|
|
113
|
-
This command can be used to handily make new GitHub/GitLab pull/merge requests
|
113
|
+
This command can be used to handily make new GitHub/GitLab pull/merge requests from the command line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
|
114
114
|
|
115
|
-
After setup is complete, you can call the
|
115
|
+
After setup is complete, you can call the command like this:
|
116
116
|
|
117
117
|
```bash
|
118
|
-
git-helper code-request
|
119
|
-
# OR
|
120
|
-
git-helper code-request -m
|
118
|
+
git-helper code-request
|
121
119
|
```
|
122
120
|
|
123
|
-
|
121
|
+
The command will provide an autogenerated code request title based on your branch name. It will separate the branch name by `'_'` if underscores are in the branch, or `'-'` if dashes are present. Then it will join the list of words together by spaces. If there's a pattern in the form of `jira-123` or `jira_123` in the first part of the branch name, then it'll add `JIRA-123` to the first part of the code request. You can respond 'yes' or 'no'. If you respond 'no', you can provide your own code request title.
|
124
122
|
|
125
123
|
The command will also ask you if the default branch of the repository is the proper base branch to use. You can say 'yes' or 'no'. If you respond 'no', then you can give the command your chosen base base.
|
126
124
|
|
127
|
-
|
128
|
-
|
129
|
-
If you're requesting to merge a code request, the command will ask you the number ID of the code request you wish to merge. For GitHub, the command will also ask you what type of merge to do: regular merging, squashing, or rebasing. The commit message to use during the merge/squash/rebase will be the title of the pull request. For GitLab, the command will also ask you what type of merge to do: regular merging or squashing. The commit message to use during the merge/squash will be the title of the merge request.
|
125
|
+
If your project uses GitLab, the command will potentially ask you if you'd like to delete the source branch upon merge. If the project defaults to deleting the source branch, then the script will use that selection, and the value can be changed for a specific MR either over the API or in the browser. If the project just provides source branch deletion as on option, then it'll ask the user. It also will probably ask you if you'd like to squash the MR upon merge. If the project requires or prevents squashing, then whatever answer you give will be _*ignored*_. This is unfortunate, but is here due to limited API functionality.
|
130
126
|
|
131
|
-
|
127
|
+
Lastly, it'll ask about code request templates. For GitHub, it'll ask the user to apply any pull request templates found at `.github/pull_request_template.md`, `./pull_request_template.md`, or `.github/PULL_REQUEST_TEMPLATE/*.md`. Applying any template is optional, and a user can make an empty pull request if they desire. For GitLab, it'll ask the user to apply any merge request templates found at any `.gitlab/merge_request_template.md`, `./merge_request_template.md`, or `.gitlab/merge_request_templates/*.md`. Applying any template is optional, and from the command's standpoint, a user can make an empty merge request if they desire (although GitLab may still add a merge request template if the project itself requires one). When searching for templates, the code ignores cases, so the file could be named with all capital letters or all lowercase letters.
|
132
128
|
|
133
129
|
### `empty-commit`
|
134
130
|
|
@@ -146,6 +142,23 @@ This command is handy if you locally have a bunch of commits you wish to complet
|
|
146
142
|
git-helper forget-local-commits
|
147
143
|
```
|
148
144
|
|
145
|
+
### `merge-code-request`
|
146
|
+
|
147
|
+
This command can be used to merge pull/merge requests from the command line. The command uses either the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) or [`Gitlab` client](https://github.com/NARKOZ/gitlab) to do this, so make sure you have a `~/.git_helper/config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Gem Usage](#gem-usage).
|
148
|
+
|
149
|
+
After setup is complete, you can call the proper command like this:
|
150
|
+
|
151
|
+
```bash
|
152
|
+
git-helper merge-code-request
|
153
|
+
```
|
154
|
+
|
155
|
+
The command will ask you the number ID of the code request you wish to merge.
|
156
|
+
|
157
|
+
If using GitHub _and_ the repository allows multiple types of merges (merge/squash/rebase), then the command will ask the user what type of merge to do. It'll only let users select a type of merge the repository allows. If a repository only allows one type of merging, then the command will automatically use that. The commit message to use during the merge/squash/rebase will be the title of the pull request.
|
158
|
+
|
159
|
+
For GitLab, the command will use whatever squash/source branch deletion/etc settings are already set on the merge request, so make sure you click the proper checkboxes in the MR manually or over the API before running this command. The commit message to use during the merge/squash will be the title of the merge request.
|
160
|
+
|
161
|
+
|
149
162
|
### `new-branch`
|
150
163
|
|
151
164
|
This command is useful for making new branches in a repository on the command line. To run the command, run:
|
@@ -164,7 +177,7 @@ To submit a feature request, bug ticket, etc, please submit an official [GitHub
|
|
164
177
|
|
165
178
|
To report any security vulnerabilities, please view this project's [Security Policy](https://github.com/emmasax4/git_helper/security/policy).
|
166
179
|
|
167
|
-
|
180
|
+
When interacting with this repository, please follow [Contributor Covenant's Code of Conduct](https://contributor-covenant.org).
|
168
181
|
|
169
182
|
## Releasing
|
170
183
|
|
data/bin/git-helper
CHANGED
@@ -63,21 +63,17 @@ command 'new-branch' do |c|
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
desc '
|
67
|
-
command 'code-request' do |c|
|
68
|
-
c.switch [:c, :create], desc: 'Create a new pull/merge request'
|
69
|
-
c.switch [:m, :merge], desc: 'Merge an existing pull/merge request'
|
70
|
-
|
66
|
+
desc 'Merge a GitHub/GitLab pull/merge request. The command will figure out whether your code project belongs to GitHub or GitLab.'
|
67
|
+
command 'merge-code-request' do |c|
|
71
68
|
c.action do |global_options, options, args|
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
GitHelper::CodeRequest.new.merge
|
70
|
+
end
|
71
|
+
end
|
75
72
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
73
|
+
desc 'Create a GitHub/GitLab pull/merge request from the current branch. The command will figure out whether your code project belongs to GitHub or GitLab.'
|
74
|
+
command 'code-request' do |c|
|
75
|
+
c.action do |global_options, options, args|
|
76
|
+
GitHelper::CodeRequest.new.create
|
81
77
|
end
|
82
78
|
end
|
83
79
|
|
data/lib/git_helper/version.rb
CHANGED
data/plugins.zip
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emma Sax
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|