geet 0.29.0 → 0.30.0

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: 8cc15ce51e73bea607f37e1b46cfeeea160fd578373dd691ca426f605a761410
4
- data.tar.gz: 775d0a7d562a5efa412186bc209978006ac05cc9c6c6926d485c15bd6ca2def0
3
+ metadata.gz: 2831ac20b611ce85881660ca5eed68be1b713a22ab2c10fa2f4cc7678c8d6307
4
+ data.tar.gz: 93208d52279d38a41e4ff7deccd73b91404370c56b791d226d9f7a680f9c8aec
5
5
  SHA512:
6
- metadata.gz: c11603363f1ef2c3a0bce61bdb292c9957a243064ab1f6318011d2aef98e2922db8eac2f44b2fcd54d3f93ba31b60a886ae0eca7505dec23882d8c923907a3c7
7
- data.tar.gz: 9934a7935c4ad0c9b54f6aaa059cb74739a2e6806878de852491bcdc4ab5af81dbfa462bd895a5e7417cb875927b4766b09e2c6dd4b43c40056edee5b41f8a20
6
+ metadata.gz: bd957bdf51d0dfc4c015d0b800e43668c55eef6aa445302e960a85840785a2ce5a171468c0dcf83b4f9f43483a5eaf03afaf4ec02d4607261341b7f56c6165b7
7
+ data.tar.gz: 1c7d2c8e204c933fce79d22ced60530fae5868e1728dae2d8c9033152f22e9489cbf5a50cecaac103c1b341c068d744ac9eb8717bf77f94770f7cf767452d27c
@@ -96,6 +96,7 @@ module Geet
96
96
  # rubocop:disable Style/MutableConstant
97
97
  PR_MERGE_OPTIONS = T.let([
98
98
  ["-d", "--delete-branch", "Delete the branch after merging"],
99
+ ["-r", "--rebase", "Rebase merge"],
99
100
  ["-s", "--squash", "Squash merge"],
100
101
  ["-u", "--upstream", "List on the upstream repository"],
101
102
  long_help: "Merge the PR for the current branch",
@@ -29,11 +29,15 @@ module Geet
29
29
  sig {
30
30
  params(
31
31
  delete_branch: T::Boolean,
32
+ rebase: T::Boolean,
32
33
  squash: T::Boolean
33
34
  )
34
35
  .returns(Github::PR)
35
36
  }
36
- def execute(delete_branch: false, squash: false)
37
+ def execute(delete_branch: false, rebase: false, squash: false)
38
+ raise "Can't specify both --rebase and --squash" if rebase && squash
39
+
40
+ merge_method = "rebase" if rebase
37
41
  merge_method = "squash" if squash
38
42
 
39
43
  @git_client.fetch
@@ -62,12 +66,12 @@ module Geet
62
66
  # currently, it's not important.
63
67
  #
64
68
  checkout_branch(main_branch)
65
- rebase
69
+ rebase_main
66
70
 
67
- # When squashing, we need to force delete, since Git doesn't recognize that the branch has
68
- # been merged.
71
+ # When squashing or rebasing, we need to force delete, since Git doesn't recognize that the
72
+ # branch has been merged (the commits on the main branch have different SHAs).
69
73
  #
70
- delete_local_branch(pr_branch, force: squash)
74
+ delete_local_branch(pr_branch, force: squash || rebase)
71
75
  end
72
76
 
73
77
  pr
@@ -112,7 +116,7 @@ module Geet
112
116
  end
113
117
 
114
118
  sig { void }
115
- def rebase
119
+ def rebase_main
116
120
  @out.puts "Rebasing..."
117
121
 
118
122
  @git_client.rebase
data/lib/geet/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module Geet
5
- VERSION = "0.29.0"
5
+ VERSION = "0.30.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi