geet 0.28.2 → 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: 9c532c156ba96e5c0fc54a5a85be8eb0912fede8e160ccd5107a2904df2f638c
4
- data.tar.gz: 5365945814030ca17470f1b2cd8a02e0a6de5ef315e9028a51ba873005efb719
3
+ metadata.gz: 2831ac20b611ce85881660ca5eed68be1b713a22ab2c10fa2f4cc7678c8d6307
4
+ data.tar.gz: 93208d52279d38a41e4ff7deccd73b91404370c56b791d226d9f7a680f9c8aec
5
5
  SHA512:
6
- metadata.gz: 5f6d7d4588a41492faed07b2a6c5ad6239fbf9cb5f261a79f51955d9c60bade516ca64bdf63ea375746885f89c5484c8c3b8ce0a5a2f2ebd699bb669bd047bd9
7
- data.tar.gz: 17dec4695b03b19a4360d4157dbc8cc6ee7e521daf5a4a04c486f238819b4e85a6c922b2230ec8848af995148927b0082f570c69e5414b216d2dbb24f4248bf8
6
+ metadata.gz: bd957bdf51d0dfc4c015d0b800e43668c55eef6aa445302e960a85840785a2ce5a171468c0dcf83b4f9f43483a5eaf03afaf4ec02d4607261341b7f56c6165b7
7
+ data.tar.gz: 1c7d2c8e204c933fce79d22ced60530fae5868e1728dae2d8c9033152f22e9489cbf5a50cecaac103c1b341c068d744ac9eb8717bf77f94770f7cf767452d27c
data/README.md CHANGED
@@ -23,7 +23,7 @@ Everything is tracked in detail via [issues](https://github.com/saveriomiroddi/g
23
23
 
24
24
  Geet requires the API token environment variable to be set, eg:
25
25
 
26
- export GITHUB_API_TOKEN=0123456789abcdef0123456789abcdef
26
+ export GH_TOKEN=0123456789abcdef0123456789abcdef
27
27
 
28
28
  All the commands need to be run from the git repository.
29
29
 
data/geet.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.required_ruby_version = ">= 3.2.0"
10
10
  s.authors = ["Saverio Miroddi"]
11
- s.date = "2026-04-02"
11
+ s.date = "2026-05-12"
12
12
  s.email = ["saverio.pub2@gmail.com"]
13
13
  s.homepage = "https://github.com/saveriomiroddi/geet"
14
14
  s.summary = "Commandline interface for performing SCM host operations, eg. create a PR on GitHub"
@@ -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",
@@ -202,7 +202,7 @@ module Geet
202
202
 
203
203
  sig { returns(String) }
204
204
  def extract_env_api_token
205
- ENV["GITHUB_API_TOKEN"] || raise("GITHUB_API_TOKEN not set!")
205
+ ENV["GH_TOKEN"] || raise("GH_TOKEN not set!")
206
206
  end
207
207
  end
208
208
  end
@@ -10,7 +10,7 @@ module Geet
10
10
 
11
11
  include Geet::Helpers::OsHelper
12
12
 
13
- API_TOKEN_KEY = "GITHUB_API_TOKEN"
13
+ API_TOKEN_KEY = "GH_TOKEN"
14
14
  DEFAULT_GIT_CLIENT = Geet::Utils::GitClient.new
15
15
 
16
16
  sig { params(out: T.any(IO, StringIO)).void }
@@ -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.28.2"
5
+ VERSION = "0.30.0"
6
6
  end
data/spec/spec_helper.rb CHANGED
@@ -18,7 +18,7 @@ VCR.configure do |config|
18
18
  # See https://github.com/vcr/vcr/issues/201
19
19
  config.filter_sensitive_data("<GITHUB_CREDENTIALS>") do
20
20
  user = ""
21
- api_token = ENV.fetch("GITHUB_API_TOKEN")
21
+ api_token = ENV.fetch("GH_TOKEN")
22
22
 
23
23
  Base64.strict_encode64("#{user}:#{api_token}")
24
24
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.2
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-02 00:00:00.000000000 Z
10
+ date: 2026-05-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64