geet 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06e8a6a20ed456c7b17bfde4830eb57877163ef09487de59b67238011638177a
4
- data.tar.gz: 2e0205cbd2447689d9fdcf55fd1a8bdba9de5c72301aff16823cc4baf2a7c2bc
3
+ metadata.gz: 65b80e94214a854c8cf6407560d97051f4882cdd11b34f9c3031b2b288a9a2c6
4
+ data.tar.gz: b9eba4b14a9238c3ea09cb9d370ad91a6768ce8ca4d3ca5a4b7c93d29bc56bad
5
5
  SHA512:
6
- metadata.gz: 6a493c1b2ab0250859d215f06271f27d2c2caabcc819c049623d644a12351ceaaca7668ad765f62887317de36c2213847addb9e95aeba258ee7263d70f58e3f6
7
- data.tar.gz: a9774631c431a33e6a6eb9851953e3294978086ecc51ebe1d3f9e33b2a64392a796c1894019ce9f1515186f81d8800f659dde509d325c84f1dc628e1df02370f
6
+ metadata.gz: 07c2b9f337bc0f3e3b991f4bd6e95d61f5827a2fcb00fafb265efe260ca73636e4c0fcf29ba688038ee670032cbca84a620ef65aaa4ddebb25f0cb337ba5a86e
7
+ data.tar.gz: 1f56fce624d2f9252d3b99ce9ddc0b71bf0674e8ff2e0339a219edf35fc0a4faa094c42030ff97f88798e0df724d38f72465dad2e0d7b6bd2a8d6fae4090e971
data/bin/geet CHANGED
@@ -49,7 +49,7 @@ class GeetLauncher
49
49
  when MILESTONE_LIST_COMMAND
50
50
  Services::ListMilestones.new(repository).execute
51
51
  when PR_CREATE_COMMAND
52
- summary = options[:summary] || edit_pr_summary
52
+ summary = options[:summary] || edit_pr_summary(base: options[:base])
53
53
  title, description = split_summary(summary)
54
54
 
55
55
  options = default_to_manual_selection(options, :labels, :milestone, :reviewers)
@@ -66,11 +66,13 @@ class GeetLauncher
66
66
 
67
67
  private
68
68
 
69
- def edit_pr_summary
69
+ def edit_pr_summary(base: nil)
70
+ base ||= 'master'
71
+
70
72
  # Tricky. It would be best to have Git logic exlusively inside the services,
71
73
  # but at the same time, the summary editing should be out.
72
74
  git = Utils::GitClient.new
73
- pr_commits = git.cherry('master')
75
+ pr_commits = git.cherry(base)
74
76
 
75
77
  if pr_commits.size == 1
76
78
  prepopulated_summary = git.show_description('HEAD')
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.3.0'
12
12
  s.authors = ['Saverio Miroddi']
13
- s.date = '2018-04-01'
13
+ s.date = '2018-04-12'
14
14
  s.email = ['saverio.pub2@gmail.com']
15
15
  s.homepage = 'https://github.com/saveriomiroddi/geet'
16
16
  s.summary = 'Commandline interface for performing SCM (eg. GitHub) operations (eg. PR creation).'
@@ -52,6 +52,7 @@ module Geet
52
52
  PR_CREATE_OPTIONS = [
53
53
  ['-A', '--automated-mode', "Automate the branch operations (see long help)"],
54
54
  ['-n', '--no-open-pr', "Don't open the PR link in the browser after creation"],
55
+ ['-b', '--base develop', "Specify the base branch; defaults to `master`"],
55
56
  ['-l', '--labels "legacy,code review"', 'Labels'],
56
57
  ['-m', '--milestone 1.5.0', 'Milestone title pattern'],
57
58
  ['-r', '--reviewers john,tom,adrian,kevin', 'Reviewer logins'],
@@ -70,11 +70,11 @@ module Geet
70
70
  attempt_provider_call(:Milestone, :list, api_interface)
71
71
  end
72
72
 
73
- def create_pr(title, description, head)
73
+ def create_pr(title, description, head, base: nil)
74
74
  confirm(LOCAL_ACTION_ON_UPSTREAM_REPOSITORY_MESSAGE) if local_action_on_upstream_repository? && @warnings
75
75
  confirm(ACTION_ON_PROTECTED_REPOSITORY_MESSAGE) if action_on_protected_repository? && @warnings
76
76
 
77
- attempt_provider_call(:PR, :create, title, description, head, api_interface)
77
+ attempt_provider_call(:PR, :create, title, description, head, api_interface, base: base)
78
78
  end
79
79
 
80
80
  def prs(head: nil)
@@ -8,15 +8,16 @@ module Geet
8
8
  class PR < AbstractIssue
9
9
  # See https://developer.github.com/v3/pulls/#create-a-pull-request
10
10
  #
11
- def self.create(title, description, head, api_interface)
11
+ def self.create(title, description, head, api_interface, base: nil)
12
12
  api_path = 'pulls'
13
+ base ||= 'master'
13
14
 
14
15
  if api_interface.upstream?
15
16
  authenticated_user = Geet::Github::User.authenticated(api_interface).username
16
17
  head = "#{authenticated_user}:#{head}"
17
18
  end
18
19
 
19
- request_data = { title: title, body: description, head: head, base: 'master' }
20
+ request_data = { title: title, body: description, head: head, base: base }
20
21
 
21
22
  response = api_interface.send_request(api_path, data: request_data)
22
23
 
@@ -23,7 +23,7 @@ module Geet
23
23
  #
24
24
  def execute(
25
25
  title, description, labels: nil, milestone: nil, reviewers: nil,
26
- no_open_pr: nil, automated_mode: false, **
26
+ base: nil, no_open_pr: nil, automated_mode: false, **
27
27
  )
28
28
  ensure_clean_tree if automated_mode
29
29
 
@@ -37,7 +37,7 @@ module Geet
37
37
 
38
38
  sync_with_upstream_branch if automated_mode
39
39
 
40
- pr = create_pr(title, description)
40
+ pr = create_pr(title, description, base)
41
41
 
42
42
  if user_has_write_permissions
43
43
  edit_pr(pr, selected_labels, selected_milestone, selected_reviewers)
@@ -93,10 +93,10 @@ module Geet
93
93
  end
94
94
  end
95
95
 
96
- def create_pr(title, description)
96
+ def create_pr(title, description, base)
97
97
  @out.puts 'Creating PR...'
98
98
 
99
- @repository.create_pr(title, description, @git_client.current_branch)
99
+ @repository.create_pr(title, description, @git_client.current_branch, base: base)
100
100
  end
101
101
 
102
102
  def edit_pr(pr, labels, milestone, reviewers)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geet
4
- VERSION = '0.3.5'
4
+ VERSION = '0.3.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-01 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting