git_curate 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +3 -0
- data/VERSION +1 -1
- data/git_curate.gemspec +2 -2
- 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 +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b33e072a71943724778d39da1a00e03c8f35c35880ae4c17eb15195a22847529
|
4
|
+
data.tar.gz: 45cb3068e500a04742c5514aa1b06e8aae2b0dfeff3796a6e4669555e23aa611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85bab3c9cc97daf93ddf278713b8a7aad010c406cdcc940af7e100aebd7aa99d5c5b69a613ea736f990076718e628d7be7b92b18706ca35c63482980d9e11248
|
7
|
+
data.tar.gz: 4da0223e68e991c394ea88df0a8c0238100234ddc92d3a95c8823e52be428997835fc820ee23286ae9b3363dd9b49fedd541e2955668d1c66afd1800bb95bc8e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -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.
|
1
|
+
1.3.0
|
data/git_curate.gemspec
CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
31
|
spec.add_runtime_dependency "highline", "2.0.3"
|
32
|
-
spec.add_runtime_dependency "rugged", "1.
|
33
|
-
spec.add_runtime_dependency "tabulo", "2.8.
|
32
|
+
spec.add_runtime_dependency "rugged", "1.5.0.1"
|
33
|
+
spec.add_runtime_dependency "tabulo", "2.8.1"
|
34
34
|
spec.add_runtime_dependency "tty-screen", "0.8.1"
|
35
35
|
|
36
36
|
spec.add_development_dependency "bundler"
|
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: 1.
|
4
|
+
version: 1.3.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-
|
11
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.5.0.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.5.0.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.
|
47
|
+
version: 2.8.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.
|
54
|
+
version: 2.8.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tty-screen
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|