git_curate 1.2.1 → 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: 50c509c86ea95a040e7585fe963ddf1dcc393a5119ca88b13f0b80979e8cd228
4
- data.tar.gz: c5d43923dbd54b153d087680f25e8af9b9428f63fce7c72a6371d9b30a9ae080
3
+ metadata.gz: 2a0ee304e6cab6c803ee81bd99bf82c1661fd1c68f557eb24875792b88e1266e
4
+ data.tar.gz: 20dd86ced273f4628b46fc3e59270e03032e42cdc242433b2ba243a12c19e2ba
5
5
  SHA512:
6
- metadata.gz: c73b1abed7812ef99ca538d6d68946feda57320f0b4ee37885bd083b00ea8e675d6aa0c0a696dff6ffa881fa8fc9d7758c6e4ce73cb0ad4aeea5c9c5435e5b9d
7
- data.tar.gz: 36c31763289bb4a50de7bb585d32308ffab6593a0116fce702578deddd8f8ea6e3268ae4dbd71d7a97727edf977a4d584e9f042a80ff5b57ec678c0c8b32f3e1
6
+ metadata.gz: 21086dfee0cba8c1ae9189128ea248c28d9540f8d1e32aeaef7d34c872edd95589818a55d4c3af5fd21d93917b23c01e5e2bc57962bb144fa699f8535eadc3ec
7
+ data.tar.gz: a61468f68ba04f4a173aa73e4c7cc92add97afd3596e624f4848e6d3e8fe4be1b6e63726a69baaf2175d951159c15fb25cce9ba2c1be29651ff65d9d629a786a
@@ -19,12 +19,9 @@ jobs:
19
19
  strategy:
20
20
  matrix:
21
21
  ruby-version: [
22
- '2.4.10',
23
- '2.5.9',
24
- '2.6.10',
25
- '2.7.6',
26
- '3.0.4',
27
- '3.1.2',
22
+ '3.1.4',
23
+ '3.2.3',
24
+ '3.3.0',
28
25
  ]
29
26
  steps:
30
27
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ### v2.0.0
4
+
5
+ * Dependency version upgrades
6
+ * Require Ruby 3.1.0
7
+
8
+ ### v1.3.0
9
+
10
+ * Add --merged and --no-merged options
11
+ * Dependency version upgrades
12
+
3
13
  ### v1.2.1
4
14
 
5
15
  * Dependency version upgrades
data/README.md CHANGED
@@ -32,7 +32,7 @@ as per their remote repository, you should run `git fetch` first.
32
32
 
33
33
  ## Installation
34
34
 
35
- You’ll need Ruby (v2.4.9 or greater) installed. Run:
35
+ You’ll need Ruby (v3.1.0 or greater) installed. Run:
36
36
 
37
37
  ```
38
38
  gem install git_curate
@@ -75,6 +75,9 @@ If you just want to view the information about your local branches without stepp
75
75
  them interactively, enter `git curate --list` or `git curate -l`. Your current branch _will_
76
76
  be included in this list in this case.
77
77
 
78
+ You can also pass `--merged` to see only those branches merged into current `HEAD`; or `--no-merged`
79
+ to see only those branches _not_ merged into current `HEAD`.
80
+
78
81
  ## Contributing
79
82
 
80
83
  Bug reports and pull requests are welcome on [GitHub](https://github.com/matt-harvey/git_curate).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 2.0.0
data/git_curate.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/matt-harvey/git_curate"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = ">= 2.4.9"
17
+ spec.required_ruby_version = ">= 3.1.0"
18
18
 
19
19
  spec.metadata = {
20
20
  "source_code_uri" => "https://github.com/matt-harvey/git_curate",
@@ -28,10 +28,10 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_runtime_dependency "highline", "2.0.3"
32
- spec.add_runtime_dependency "rugged", "1.4.3"
33
- spec.add_runtime_dependency "tabulo", "2.8.0"
34
- spec.add_runtime_dependency "tty-screen", "0.8.1"
31
+ spec.add_runtime_dependency "highline", "3.0.1"
32
+ spec.add_runtime_dependency "rugged", "1.7.1"
33
+ spec.add_runtime_dependency "tabulo", "3.0.1"
34
+ spec.add_runtime_dependency "tty-screen", "0.8.2"
35
35
 
36
36
  spec.add_development_dependency "bundler"
37
37
  spec.add_development_dependency "rake", "~> 13.0"
@@ -60,14 +60,16 @@ module GitCurate
60
60
  end
61
61
 
62
62
  # Returns the local branches
63
- def self.local
63
+ def self.local(merged_opt)
64
64
  toplevel_dir = Util.command_output("git rev-parse --show-toplevel").strip
65
65
  repo = Rugged::Repository.new(toplevel_dir)
66
66
 
67
67
  rugged_branches = repo.branches
68
68
  repo_head_target = repo.head.target
69
69
 
70
- Util.command_to_a("git branch").map do |line|
70
+ command = "git branch" + (merged_opt ? " #{merged_opt}" : "")
71
+
72
+ Util.command_to_a(command).map do |line|
71
73
  raw_branch_name = line.strip
72
74
  proper_branch_name = raw_branch_name.gsub(CURRENT_BRANCH_REGEX, "")
73
75
  rugged_branch = rugged_branches[proper_branch_name]
@@ -38,6 +38,20 @@ module GitCurate
38
38
  self.parsed_options[:list] = true
39
39
  end
40
40
 
41
+ opts.on(
42
+ "--merged",
43
+ "Only list branches whose tips are reachable from HEAD",
44
+ ) do
45
+ self.parsed_options[:merged_opt] = "--merged"
46
+ end
47
+
48
+ opts.on(
49
+ "--no-merged",
50
+ "Only list branches whose tips are not reachable from HEAD",
51
+ ) do
52
+ self.parsed_options[:merged_opt] = "--no-merged"
53
+ end
54
+
41
55
  opts.on("-h", "Print this help message") do
42
56
  puts opts
43
57
  return false
@@ -26,7 +26,7 @@ module GitCurate
26
26
  return EXIT_FAILURE
27
27
  end
28
28
 
29
- branches = Branch.local
29
+ branches = Branch.local(@opts[:merged_opt])
30
30
  branches.reject!(&:current?) if interactive?
31
31
 
32
32
  table = Tabulo::Table.new(branches, border: :reduced_ascii, column_padding: 0, align_header: :left) do |t|
@@ -47,7 +47,7 @@ module GitCurate
47
47
  branches_to_delete = []
48
48
 
49
49
  if !interactive?
50
- puts table
50
+ puts table if branches.any?
51
51
  return EXIT_SUCCESS
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module GitCurate
2
- VERSION = "1.2.1"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_curate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Harvey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-01 00:00:00.000000000 Z
11
+ date: 2024-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.3
19
+ version: 3.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.3
26
+ version: 3.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rugged
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.4.3
33
+ version: 1.7.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.4.3
40
+ version: 1.7.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tabulo
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.8.0
47
+ version: 3.0.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.8.0
54
+ version: 3.0.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: tty-screen
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.1
61
+ version: 0.8.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.8.1
68
+ version: 0.8.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -197,14 +197,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - ">="
199
199
  - !ruby/object:Gem::Version
200
- version: 2.4.9
200
+ version: 3.1.0
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
203
  - - ">="
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  requirements: []
207
- rubygems_version: 3.2.3
207
+ rubygems_version: 3.5.3
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Simple git branch curation tool