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 +4 -4
- data/.github/workflows/tests.yml +3 -6
- data/CHANGELOG.md +10 -0
- data/README.md +4 -1
- data/VERSION +1 -1
- data/git_curate.gemspec +5 -5
- data/lib/git_curate/branch.rb +4 -2
- data/lib/git_curate/cli_parser.rb +14 -0
- data/lib/git_curate/runner.rb +2 -2
- data/lib/git_curate/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a0ee304e6cab6c803ee81bd99bf82c1661fd1c68f557eb24875792b88e1266e
|
4
|
+
data.tar.gz: 20dd86ced273f4628b46fc3e59270e03032e42cdc242433b2ba243a12c19e2ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21086dfee0cba8c1ae9189128ea248c28d9540f8d1e32aeaef7d34c872edd95589818a55d4c3af5fd21d93917b23c01e5e2bc57962bb144fa699f8535eadc3ec
|
7
|
+
data.tar.gz: a61468f68ba04f4a173aa73e4c7cc92add97afd3596e624f4848e6d3e8fe4be1b6e63726a69baaf2175d951159c15fb25cce9ba2c1be29651ff65d9d629a786a
|
data/.github/workflows/tests.yml
CHANGED
data/CHANGELOG.md
CHANGED
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 (
|
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.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 = ">=
|
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", "
|
32
|
-
spec.add_runtime_dependency "rugged", "1.
|
33
|
-
spec.add_runtime_dependency "tabulo", "
|
34
|
-
spec.add_runtime_dependency "tty-screen", "0.8.
|
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"
|
data/lib/git_curate/branch.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/git_curate/runner.rb
CHANGED
@@ -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
|
|
data/lib/git_curate/version.rb
CHANGED
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:
|
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:
|
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:
|
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:
|
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.
|
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.
|
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:
|
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:
|
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.
|
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.
|
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:
|
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.
|
207
|
+
rubygems_version: 3.5.3
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Simple git branch curation tool
|