git_helper 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8f1759701099c875fd08dd2b4fe00f55732c7d005a3437a5adea5019bbcf78b
4
- data.tar.gz: e659e2c1bc529059854e9d35daa3d8afea6f9e13877d6cd1681b621a299995f0
3
+ metadata.gz: 929b169f934f99ecd468e7fb78080b0ea0059192f912ee8492ee35c0dfae7bfa
4
+ data.tar.gz: 9a5302fc0a26595b048cbc03e2d2e6e2d4ad4b207219e2c06b1cc732fb7be5b0
5
5
  SHA512:
6
- metadata.gz: 01f01fcf9cb8e962a07488e76ae04f2ac0b0e612c089b7479da39f26598adccd8c005fa85d38bd430a5642fc8d1760e4738d3ef76759c77eb7cbce1926ff34d3
7
- data.tar.gz: 9e7b63ec6d2ed7b62ca689c1cfd33eeb5830becdfef13fffe06f068a9181834393e5f4ff3f1885df2f63b12a1a90f4f22024d4d72a3d88ea4c0c7191a8fa90a8
6
+ metadata.gz: f6dd7318464df844707836bef67b9cb9addc580785edb8a57cf694f9e5a3af69f7efe18888aa0936cfdd3bfbc4a3848c90e142603501a2d3251d9618c26ed19c
7
+ data.tar.gz: ca79af7651e083f543a1a5bb89f54cec6506958dd653556afa235a3b0bad82a673fa70a3df7f9460033c1f76c5bcd76eb4081127c68f7e237a714e383d028a53
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_helper (1.0.0)
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 (12.3.3)
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 (2.99.0)
69
- rspec-core (~> 2.99.0)
70
- rspec-expectations (~> 2.99.0)
71
- rspec-mocks (~> 2.99.0)
72
- rspec-core (2.99.2)
73
- rspec-expectations (2.99.2)
74
- diff-lcs (>= 1.1.3, < 2.0)
75
- rspec-mocks (2.99.4)
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 (~> 12.3.3)
94
- rspec (~> 2.99)
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, and then 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:
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,37 +93,49 @@ 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
- ### `empty-commit`
102
+ ### `code-request`
103
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:
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).
105
+
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`.
105
107
 
106
108
  ```bash
107
- git-helper empty-commit
109
+ git-helper code-request -c
110
+ # OR
111
+ git-helper code-request -m
108
112
  ```
109
113
 
110
- ### `merge-request`
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.
115
+
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.
117
+
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.
119
+
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.
111
121
 
112
- This command can be used to handily make new GitLab merge requests and to accept merge requests from the command line. The command uses the Ruby wrapper [`Gitlab`](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).
122
+ If you're getting stuck, you can run the command with a `--help` flag instead, to get some more information.
123
+
124
+ ### `empty-commit`
113
125
 
114
- 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`.
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:
115
127
 
116
128
  ```bash
117
- git-helper merge-request -c
118
- # OR
119
- git-helper merge-request -m
129
+ git-helper empty-commit
120
130
  ```
121
131
 
122
- If you're trying to create a merge request, the command will provide an autogenerated merge request title based on your branch name (separated by `_`). You can respond 'yes' or 'no'. If you respond 'no', you can provide your own merge request title. 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. 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.
132
+ ### `forget-local-commits`
123
133
 
124
- If you're requesting to merge a merge request, the command will ask you the number ID of the merge request you wish to accept. 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 pull request.
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:
125
135
 
126
- If you're getting stuck, you can run the command with a `--help` flag instead, to get some more information.
136
+ ```bash
137
+ git-helper forget-local-commits
138
+ ```
127
139
 
128
140
  ### `new-branch`
129
141
 
@@ -137,24 +149,6 @@ git-helper new-branch NEW_BRANCH_NAME
137
149
 
138
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.
139
151
 
140
- ### `pull-request`
141
-
142
- This command can be used to handily make new GitHub pull requests and to merge pull requests from the command line. The command uses the [`Octokit::Client`](https://octokit.github.io/octokit.rb/Octokit/Client.html) 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).
143
-
144
- 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`.
145
-
146
- ```bash
147
- git-helper pull-request -c
148
- # OR
149
- git-helper pull-request -m
150
- ```
151
-
152
- If you're trying to create a pull request, the command will provide an autogenerated pull request title based on your branch name (separated by `_`). You can respond 'yes' or 'no'. If you respond 'no', you can provide your own pull request title. 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. Lastly, it'll ask the user to apply any pull 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.
153
-
154
- If you're requesting to merge a pull request, the command will ask you the number ID of the pull request you wish to merge. 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.
155
-
156
- If you're getting stuck, you can run the command with a `--help` flag instead, to get some more information.
157
-
158
152
  ## Contributing
159
153
 
160
154
  To submit a feature request, bug ticket, etc, please submit an official [GitHub Issue](https://github.com/emmasax4/git_helper/issues/new).
@@ -162,3 +156,16 @@ To submit a feature request, bug ticket, etc, please submit an official [GitHub
162
156
  To report any security vulnerabilities, please view this project's [Security Policy](https://github.com/emmasax4/git_helper/security/policy).
163
157
 
164
158
  This repository does have a standard [Code of Conduct](https://github.com/emmasax4/git_helper/blob/main/.github/code_of_conduct.md).
159
+
160
+ ## Releasing
161
+
162
+ To make a new release of this gem:
163
+
164
+ 1. Merge the pull request via the big green button
165
+ 2. Run `git tag vX.X.X` and `git push --tag`
166
+ 3. Make a new release [here](https://github.com/emmasax4/git_helper/releases/new)
167
+ 4. Run `gem build *.gemspec`
168
+ 5. Run `gem push *.gem` to push the new gem to RubyGems
169
+ 6. Run `rm *.gem` to clean up your local repository
170
+
171
+ To set up your local machine to push to RubyGems via the API, see the [RubyGems documentation](https://guides.rubygems.org/publishing/#publishing-to-rubygemsorg).
@@ -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.execute(args[0], args[1])
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 'Create a GitLab merge request from the current branch.'
56
- command 'merge-request' do |c|
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/merge_request.rb'
62
- raise ArgumentError, "You must specify an action (either '-m'/'--merge' or '-c'/'--create')" unless options[:create] || options[:merge]
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 'pull-request' do |c|
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/pull_request.rb'
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::GitHubPullRequest.new.create
84
+ GitHelper::CodeRequest.new.create
96
85
  elsif options[:merge]
97
- GitHelper::GitHubPullRequest.new.merge
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
- def execute(old_owner, new_owner)
4
- current_dir = Dir.pwd
5
- nested_dirs = Dir.entries(current_dir).select do |entry|
6
- entry_dir = File.join(current_dir, entry)
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 |dir|
11
- Dir.chdir dir
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 swap_https(old_owner, new_owner, remote)
30
- repo = remote.scan(/https:\/\/[\S]+\/([\S]*).git/).first.first
31
- remote_name = remote.scan(/([a-zA-z]+)/).first.first
32
- source_name = scan(/https:\/\/([a-zA-z.]+)\//).first.first
33
- puts " Changing the remote URL #{remote_name} to be 'https://#{source_name}/#{new_owner}/#{repo}.git'."
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 swap_ssh(old_owner, new_owner, remote)
43
- repo = remote.scan(/\/([\S]*).git/).first.first
44
- remote_name = remote.scan(/([a-zA-z]+)/).first.first
45
- source_name = remote.scan(/git@([a-zA-z.]+):/).first.first
46
- puts " Changing the remote URL #{remote_name} to be 'git@#{source_name}:#{new_owner}/#{repo}.git'."
47
- begin
48
- `git remote set-url #{remote_name} git@#{source_name}:#{new_owner}/#{repo}.git`
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,7 +1,9 @@
1
+ require_relative './local_code.rb'
2
+
1
3
  module GitHelper
2
4
  class CheckoutDefault
3
5
  def execute
4
- system("git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed \"s@^refs/remotes/origin/@@\")")
6
+ GitHelper::LocalCode.new.checkout_default
5
7
  end
6
8
  end
7
9
  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
- system("git checkout $(git symbolic-ref refs/remotes/origin/HEAD | sed \"s@^refs/remotes/origin/@@\")")
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