git_helper 1.3.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +17 -13
- data/README.md +24 -38
- data/bin/git-helper +12 -23
- data/lib/git_helper/change_remote.rb +56 -40
- data/lib/git_helper/checkout_default.rb +3 -1
- data/lib/git_helper/clean_branches.rb +3 -4
- data/lib/git_helper/code_request.rb +100 -0
- data/lib/git_helper/empty_commit.rb +3 -1
- data/lib/git_helper/forget_local_commits.rb +9 -0
- data/lib/git_helper/highline_cli.rb +20 -15
- data/lib/git_helper/local_code.rb +67 -19
- data/lib/git_helper/merge_request.rb +44 -70
- data/lib/git_helper/new_branch.rb +2 -10
- data/lib/git_helper/pull_request.rb +33 -65
- data/lib/git_helper/version.rb +1 -1
- data/spec/git_helper/change_remote_spec.rb +172 -0
- data/spec/git_helper/checkout_default_spec.rb +18 -0
- data/spec/git_helper/clean_branches_spec.rb +18 -0
- data/spec/git_helper/code_request_spec.rb +258 -0
- data/spec/git_helper/empty_commit_spec.rb +18 -0
- data/spec/git_helper/forget_local_commits_spec.rb +18 -0
- data/spec/git_helper/git_config_reader_spec.rb +59 -0
- data/spec/git_helper/gitlab_client_spec.rb +25 -0
- data/spec/git_helper/highline_cli_spec.rb +214 -0
- data/spec/git_helper/local_code_spec.rb +230 -0
- data/spec/git_helper/merge_request_spec.rb +233 -0
- data/spec/git_helper/new_branch_spec.rb +43 -0
- data/spec/git_helper/octokit_client_spec.rb +25 -0
- data/spec/git_helper/pull_request_spec.rb +245 -0
- data/spec/spec_helper.rb +0 -6
- metadata +36 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 929b169f934f99ecd468e7fb78080b0ea0059192f912ee8492ee35c0dfae7bfa
|
4
|
+
data.tar.gz: 9a5302fc0a26595b048cbc03e2d2e6e2d4ad4b207219e2c06b1cc732fb7be5b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6dd7318464df844707836bef67b9cb9addc580785edb8a57cf694f9e5a3af69f7efe18888aa0936cfdd3bfbc4a3848c90e142603501a2d3251d9618c26ed19c
|
7
|
+
data.tar.gz: ca79af7651e083f543a1a5bb89f54cec6506958dd653556afa235a3b0bad82a673fa70a3df7f9460033c1f76c5bcd76eb4081127c68f7e237a714e383d028a53
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
git_helper (
|
4
|
+
git_helper (2.0.0)
|
5
5
|
gitlab (~> 4.16)
|
6
6
|
gli (~> 2.13)
|
7
7
|
highline (~> 2.0)
|
@@ -61,18 +61,23 @@ GEM
|
|
61
61
|
coderay (~> 1.1)
|
62
62
|
method_source (~> 1.0)
|
63
63
|
public_suffix (4.0.6)
|
64
|
-
rake (
|
64
|
+
rake (13.0.1)
|
65
65
|
rb-fsevent (0.10.4)
|
66
66
|
rb-inotify (0.10.1)
|
67
67
|
ffi (~> 1.0)
|
68
|
-
rspec (
|
69
|
-
rspec-core (~>
|
70
|
-
rspec-expectations (~>
|
71
|
-
rspec-mocks (~>
|
72
|
-
rspec-core (
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
rspec (3.9.0)
|
69
|
+
rspec-core (~> 3.9.0)
|
70
|
+
rspec-expectations (~> 3.9.0)
|
71
|
+
rspec-mocks (~> 3.9.0)
|
72
|
+
rspec-core (3.9.3)
|
73
|
+
rspec-support (~> 3.9.3)
|
74
|
+
rspec-expectations (3.9.2)
|
75
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
76
|
+
rspec-support (~> 3.9.0)
|
77
|
+
rspec-mocks (3.9.1)
|
78
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
79
|
+
rspec-support (~> 3.9.0)
|
80
|
+
rspec-support (3.9.3)
|
76
81
|
sawyer (0.8.2)
|
77
82
|
addressable (>= 2.3.5)
|
78
83
|
faraday (> 0.8, < 2.0)
|
@@ -88,10 +93,9 @@ PLATFORMS
|
|
88
93
|
DEPENDENCIES
|
89
94
|
bundler (~> 2.1)
|
90
95
|
git_helper!
|
91
|
-
guard (~> 2.6)
|
92
96
|
guard-rspec (~> 4.3)
|
93
|
-
rake (~>
|
94
|
-
rspec (~>
|
97
|
+
rake (~> 13.0)
|
98
|
+
rspec (~> 3.9)
|
95
99
|
|
96
100
|
BUNDLED WITH
|
97
101
|
2.1.4
|
data/README.md
CHANGED
@@ -71,7 +71,7 @@ If you're going to make using git workflows easier, might as well provide lots o
|
|
71
71
|
|
72
72
|
This can be used when switching the owners of a GitHub repo. When you switch a username, GitHub only makes some changes for you. With this command, you no longer have to manually walk through local repo and switch the remotes from each one into a remote with the new username.
|
73
73
|
|
74
|
-
This command will go through every directory in a directory, see if it is a git directory
|
74
|
+
This command will go through every directory in a directory, and see if it is a git directory. It will then ask the user if they wish to process the git directory in question. The command does not yet know if there's any changes to be made. If the user says 'yes', then it will check to see if the old username is included in the remote URL of that git directory. If it is, then the command will change the remote URL to instead point to the new username's remote URL. To run the command, run:
|
75
75
|
|
76
76
|
```bash
|
77
77
|
git-helper change-remote OLD-OWNER NEW-OWNER
|
@@ -93,75 +93,61 @@ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/CORRECT-DEFAULT-BR
|
|
93
93
|
|
94
94
|
### `clean-branches`
|
95
95
|
|
96
|
-
This command will bring you to the repository's default branch, `git pull`, `git fetch -p`, and will clean up your local branches on your machine by seeing which ones are existing on the remote, and updating yours accordingly. To run:
|
96
|
+
This command will bring you to the repository's default branch, `git pull`, `git fetch -p`, and will clean up your local branches on your machine by seeing which ones are existing on the remote, and updating yours accordingly. To clean your local branches, run:
|
97
97
|
|
98
98
|
```bash
|
99
99
|
git-helper clean-branches
|
100
100
|
```
|
101
101
|
|
102
|
-
### `
|
103
|
-
|
104
|
-
For some reason, I'm always forgetting the commands to create an empty commit. So with this command, it becomes easy. The commit message of this commit will be `'Empty commit'`. To run the command, run:
|
105
|
-
|
106
|
-
```bash
|
107
|
-
git-helper empty-commit
|
108
|
-
```
|
109
|
-
|
110
|
-
### `merge-request`
|
102
|
+
### `code-request`
|
111
103
|
|
112
|
-
This command can be used to handily make new GitLab merge requests and to
|
104
|
+
This command can be used to handily make new GitHub/GitLab pull/merge requests and to merge those 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_config.yml` file set up in the home directory of your computer. For instructions on how to do that, see [Usage](#usage).
|
113
105
|
|
114
|
-
After setup is complete, you can call the file, and send in a flag indicating whether to create a
|
106
|
+
After setup is complete, you can call the file, and send in a flag indicating whether to create a code request, `-c`, or to merge a code request, `-m`.
|
115
107
|
|
116
108
|
```bash
|
117
|
-
git-helper
|
109
|
+
git-helper code-request -c
|
118
110
|
# OR
|
119
|
-
git-helper
|
111
|
+
git-helper code-request -m
|
120
112
|
```
|
121
113
|
|
122
|
-
If you're trying to create a
|
114
|
+
If you're trying to create a code request, 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.
|
123
115
|
|
124
116
|
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.
|
125
117
|
|
126
|
-
Lastly, it'll ask the user to apply any merge request templates found at any `*/merge_request_template.md` file or any file in `.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. If a GitLab project automatically adds a template, then it may create a merge request with a default template anyway.
|
118
|
+
Lastly, for GitHub, it'll ask the user to apply any code request templates found at any `*/pull_request_template.md` file or any file in `.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 `*/merge_request_template.md` file or any file in `.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. If a GitLab project automatically adds a template, then it may create a merge request with a default template anyway.
|
127
119
|
|
128
|
-
If you're requesting to merge a
|
120
|
+
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.
|
129
121
|
|
130
122
|
If you're getting stuck, you can run the command with a `--help` flag instead, to get some more information.
|
131
123
|
|
132
|
-
### `
|
124
|
+
### `empty-commit`
|
133
125
|
|
134
|
-
|
126
|
+
For some reason, I'm always forgetting the commands to create an empty commit. So with this command, it becomes easy. The commit message of this commit will be `'Empty commit'`. To run the command, run:
|
135
127
|
|
136
128
|
```bash
|
137
|
-
git-helper
|
138
|
-
# OR
|
139
|
-
git-helper new-branch NEW_BRANCH_NAME
|
129
|
+
git-helper empty-commit
|
140
130
|
```
|
141
131
|
|
142
|
-
|
143
|
-
|
144
|
-
### `pull-request`
|
132
|
+
### `forget-local-commits`
|
145
133
|
|
146
|
-
This command
|
147
|
-
|
148
|
-
After setup is complete, you can call the file, and send in a flag indicating whether to create a pull request, `-c`, or to merge a pull request, `-m`.
|
134
|
+
This command is handy if you locally have a bunch of commits you wish to completely get rid of. This command basically does a hard reset to `origin/HEAD`. Once you forget them, they're completely gone, so run carefully. To test it out, run:
|
149
135
|
|
150
136
|
```bash
|
151
|
-
git-helper
|
152
|
-
# OR
|
153
|
-
git-helper pull-request -m
|
137
|
+
git-helper forget-local-commits
|
154
138
|
```
|
155
139
|
|
156
|
-
|
157
|
-
|
158
|
-
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.
|
140
|
+
### `new-branch`
|
159
141
|
|
160
|
-
|
142
|
+
This command is useful for making new branches in a repository on the command line. To run the command, run:
|
161
143
|
|
162
|
-
|
144
|
+
```bash
|
145
|
+
git-helper new-branch
|
146
|
+
# OR
|
147
|
+
git-helper new-branch NEW_BRANCH_NAME
|
148
|
+
```
|
163
149
|
|
164
|
-
|
150
|
+
The command either accepts a branch name right away or it will ask you for the name of your new branch. Make sure your input does not contain any spaces or special characters.
|
165
151
|
|
166
152
|
## Contributing
|
167
153
|
|
data/bin/git-helper
CHANGED
@@ -24,7 +24,7 @@ command 'change-remote' do |c|
|
|
24
24
|
c.action do |global_options, options, args|
|
25
25
|
require_relative '../lib/git_helper/change_remote.rb'
|
26
26
|
raise ArgumentError, 'You must specify an old owner and a new owner' unless args.count == 2
|
27
|
-
GitHelper::ChangeRemote.new
|
27
|
+
GitHelper::ChangeRemote.new(args[0], args[1]).execute
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -52,22 +52,11 @@ command 'empty-commit' do |c|
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
desc
|
56
|
-
command '
|
57
|
-
c.switch [:c, :create], desc: 'Create a new pull request'
|
58
|
-
c.switch [:m, :merge], desc: 'Merge an existing pull request'
|
59
|
-
|
55
|
+
desc "Reset your local git commits to origin/HEAD."
|
56
|
+
command 'forget-local-commits' do |c|
|
60
57
|
c.action do |global_options, options, args|
|
61
|
-
require_relative '../lib/git_helper/
|
62
|
-
|
63
|
-
|
64
|
-
options = global_options.merge(options)
|
65
|
-
|
66
|
-
if options[:create]
|
67
|
-
GitHelper::GitLabMergeRequest.new.create
|
68
|
-
elsif options[:merge]
|
69
|
-
GitHelper::GitLabMergeRequest.new.merge
|
70
|
-
end
|
58
|
+
require_relative '../lib/git_helper/forget_local_commits.rb'
|
59
|
+
GitHelper::ForgetLocalCommits.new.execute
|
71
60
|
end
|
72
61
|
end
|
73
62
|
|
@@ -80,21 +69,21 @@ command 'new-branch' do |c|
|
|
80
69
|
end
|
81
70
|
end
|
82
71
|
|
83
|
-
desc 'Create a GitHub pull request from the current branch.'
|
84
|
-
command '
|
85
|
-
c.switch [:c, :create], desc: 'Create a new pull request'
|
86
|
-
c.switch [:m, :merge], desc: 'Merge an existing pull request'
|
72
|
+
desc 'Create or merge a GitHub or GitLab pull/merge request from the current branch. The command will figure out whether your code project belongs to GitHub or GitLab'
|
73
|
+
command 'code-request' do |c|
|
74
|
+
c.switch [:c, :create], desc: 'Create a new pull/merge request'
|
75
|
+
c.switch [:m, :merge], desc: 'Merge an existing pull/merge request'
|
87
76
|
|
88
77
|
c.action do |global_options, options, args|
|
89
|
-
require_relative '../lib/git_helper/
|
78
|
+
require_relative '../lib/git_helper/code_request.rb'
|
90
79
|
raise ArgumentError, "You must specify an action (either '-m'/'--merge' or '-c'/'--create')" unless options[:create] || options[:merge]
|
91
80
|
|
92
81
|
options = global_options.merge(options)
|
93
82
|
|
94
83
|
if options[:create]
|
95
|
-
GitHelper::
|
84
|
+
GitHelper::CodeRequest.new.create
|
96
85
|
elsif options[:merge]
|
97
|
-
GitHelper::
|
86
|
+
GitHelper::CodeRequest.new.merge
|
98
87
|
end
|
99
88
|
end
|
100
89
|
end
|
@@ -1,55 +1,71 @@
|
|
1
|
+
require_relative './highline_cli.rb'
|
2
|
+
require_relative './local_code.rb'
|
3
|
+
|
1
4
|
module GitHelper
|
2
5
|
class ChangeRemote
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
attr_accessor :old_owner, :new_owner
|
7
|
+
|
8
|
+
def initialize(old_owner, new_owner)
|
9
|
+
@old_owner = old_owner
|
10
|
+
@new_owner = new_owner
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute
|
14
|
+
original_dir = Dir.pwd
|
15
|
+
nested_dirs = Dir.entries(original_dir).select do |entry|
|
16
|
+
entry_dir = File.join(original_dir, entry)
|
7
17
|
File.directory?(entry_dir) && !(entry == '.' || entry == '..')
|
8
18
|
end
|
9
19
|
|
10
|
-
nested_dirs.each do |
|
11
|
-
|
12
|
-
if File.exist?('.git')
|
13
|
-
puts "Found git directory: #{dir}."
|
14
|
-
remotes = `git remote -v`.split("\n")
|
15
|
-
remotes.each do |remote|
|
16
|
-
if resp.include?(old_owner)
|
17
|
-
puts " Git directory's remote is pointing to: '#{old_owner}'."
|
18
|
-
swap_ssh(old_owner, new_owner, remote) if remote.scan(/(git@)/).any?
|
19
|
-
swap_https(old_owner, new_owner, remote) if remote.scan(/(https:\/\/)/).any?
|
20
|
-
else
|
21
|
-
puts " No need to update remote."
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
Dir.chdir current_dir
|
20
|
+
nested_dirs.each do |nested_dir|
|
21
|
+
process_dir(nested_dir, original_dir)
|
26
22
|
end
|
27
23
|
end
|
28
24
|
|
29
|
-
private def
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
begin
|
35
|
-
`git remote set-url #{remote_name} https://#{source_name}:#{new_owner}/#{repo}.git`
|
36
|
-
puts " Done."
|
37
|
-
rescue Exception => e
|
38
|
-
puts " Could not complete: #{e.message}"
|
25
|
+
private def process_dir(current_dir, original_dir)
|
26
|
+
Dir.chdir(current_dir)
|
27
|
+
|
28
|
+
if File.exist?('.git')
|
29
|
+
process_git_repository if cli.process_directory_remotes?(current_dir)
|
39
30
|
end
|
31
|
+
|
32
|
+
Dir.chdir(original_dir)
|
40
33
|
end
|
41
34
|
|
42
|
-
private def
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
puts " Done."
|
50
|
-
rescue Exception => e
|
51
|
-
puts " Could not complete: #{e.message}"
|
35
|
+
private def process_git_repository
|
36
|
+
local_code.remotes.each do |remote|
|
37
|
+
if remote.include?(old_owner)
|
38
|
+
process_remote(remote)
|
39
|
+
else
|
40
|
+
puts " Found remote is not pointing to #{old_owner}."
|
41
|
+
end
|
52
42
|
end
|
43
|
+
puts "\n"
|
44
|
+
end
|
45
|
+
|
46
|
+
private def process_remote(remote)
|
47
|
+
remote_name = local_code.remote_name(remote)
|
48
|
+
|
49
|
+
if local_code.ssh_remote?(remote)
|
50
|
+
repo = local_code.remote_project(remote)
|
51
|
+
source_name = local_code.remote_source(remote)
|
52
|
+
remote_url = "git@#{source_name}:#{new_owner}/#{repo}.git"
|
53
|
+
elsif local_code.https_remote?(remote)
|
54
|
+
repo = local_code.remote_project(remote)
|
55
|
+
source_name = local_code.remote_source(remote)
|
56
|
+
remote_url = "https://#{source_name}/#{new_owner}/#{repo}.git"
|
57
|
+
end
|
58
|
+
|
59
|
+
puts " Changing the remote URL #{remote_name} to be '#{remote_url}'."
|
60
|
+
local_code.change_remote(remote_name, remote_url)
|
61
|
+
end
|
62
|
+
|
63
|
+
private def local_code
|
64
|
+
@local_code ||= GitHelper::LocalCode.new
|
65
|
+
end
|
66
|
+
|
67
|
+
private def cli
|
68
|
+
@cli ||= GitHelper::HighlineCli.new
|
53
69
|
end
|
54
70
|
end
|
55
71
|
end
|
@@ -1,10 +1,9 @@
|
|
1
|
+
require_relative './local_code.rb'
|
2
|
+
|
1
3
|
module GitHelper
|
2
4
|
class CleanBranches
|
3
5
|
def execute
|
4
|
-
|
5
|
-
system("git pull")
|
6
|
-
system("git fetch -p")
|
7
|
-
system("git branch -vv | grep \"origin/.*: gone]\" | awk '{print \$1}' | grep -v \"*\" | xargs git branch -D")
|
6
|
+
GitHelper::LocalCode.new.clean_branches
|
8
7
|
end
|
9
8
|
end
|
10
9
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require_relative './merge_request.rb'
|
2
|
+
require_relative './pull_request.rb'
|
3
|
+
require_relative './local_code.rb'
|
4
|
+
require_relative './highline_cli.rb'
|
5
|
+
|
6
|
+
module GitHelper
|
7
|
+
class CodeRequest
|
8
|
+
def create
|
9
|
+
process_project.create({
|
10
|
+
base_branch: base_branch,
|
11
|
+
new_title: new_code_request_title
|
12
|
+
})
|
13
|
+
end
|
14
|
+
|
15
|
+
def merge
|
16
|
+
process_project.merge
|
17
|
+
end
|
18
|
+
|
19
|
+
private def process_project
|
20
|
+
if local_code.github_repo? # GitHub remotes are found
|
21
|
+
# If GitLab remotes are also found, ask for clarification, else proceed with GitHub
|
22
|
+
local_code.gitlab_project? ? ask_for_clarification : github_pull_request
|
23
|
+
elsif local_code.gitlab_project? # Only GitLab remotes are found
|
24
|
+
gitlab_merge_request
|
25
|
+
else # Neither GitHub nor GitLab remotes are found
|
26
|
+
puts 'Could not locate GitHub or GitLab remote URLs.'
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private def ask_for_clarification
|
32
|
+
resp = cli.conflicting_remote_clarification
|
33
|
+
if resp.include?('hub')
|
34
|
+
github_pull_request
|
35
|
+
elsif resp.include?('lab')
|
36
|
+
gitlab_merge_request
|
37
|
+
else
|
38
|
+
puts 'The answer we received was not parseable.'
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private def github_pull_request
|
44
|
+
@github_pull_request ||= GitHelper::GitHubPullRequest.new(options)
|
45
|
+
end
|
46
|
+
|
47
|
+
private def gitlab_merge_request
|
48
|
+
@gitlab_merge_request ||= GitHelper::GitLabMergeRequest.new(options)
|
49
|
+
end
|
50
|
+
|
51
|
+
private def options
|
52
|
+
{
|
53
|
+
local_project: local_project,
|
54
|
+
local_branch: local_branch,
|
55
|
+
local_code: local_code,
|
56
|
+
cli: cli
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
private def local_project
|
61
|
+
@local_project ||= local_code.project_name
|
62
|
+
end
|
63
|
+
|
64
|
+
private def default_branch
|
65
|
+
@default_branch ||= local_code.default_branch
|
66
|
+
end
|
67
|
+
|
68
|
+
private def base_branch
|
69
|
+
@base_branch ||= if cli.base_branch_default?(default_branch)
|
70
|
+
default_branch
|
71
|
+
else
|
72
|
+
cli.base_branch
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
private def local_branch
|
77
|
+
@local_branch ||= local_code.branch
|
78
|
+
end
|
79
|
+
|
80
|
+
private def autogenerated_title
|
81
|
+
@autogenerated_title ||= local_code.generate_title(local_branch)
|
82
|
+
end
|
83
|
+
|
84
|
+
private def new_code_request_title
|
85
|
+
@new_code_request_title ||= if cli.accept_autogenerated_title?(autogenerated_title)
|
86
|
+
autogenerated_title
|
87
|
+
else
|
88
|
+
cli.title
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
private def cli
|
93
|
+
@cli ||= GitHelper::HighlineCli.new
|
94
|
+
end
|
95
|
+
|
96
|
+
private def local_code
|
97
|
+
@local_code ||= GitHelper::LocalCode.new
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|