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 +4 -4
- data/lib/geet/commandline/configuration.rb +1 -0
- data/lib/geet/services/merge_pr.rb +10 -6
- data/lib/geet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2831ac20b611ce85881660ca5eed68be1b713a22ab2c10fa2f4cc7678c8d6307
|
|
4
|
+
data.tar.gz: 93208d52279d38a41e4ff7deccd73b91404370c56b791d226d9f7a680f9c8aec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
69
|
+
rebase_main
|
|
66
70
|
|
|
67
|
-
# When squashing, we need to force delete, since Git doesn't recognize that the
|
|
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
|
|
119
|
+
def rebase_main
|
|
116
120
|
@out.puts "Rebasing..."
|
|
117
121
|
|
|
118
122
|
@git_client.rebase
|
data/lib/geet/version.rb
CHANGED