git_curate 0.2.0 → 0.3.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 +5 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +7 -4
- data/VERSION +1 -1
- data/assets/demo2.gif +0 -0
- data/lib/git_curate.rb +1 -0
- data/lib/git_curate/runner.rb +12 -1
- data/lib/git_curate/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 354154ef2b612e1b4831e2c42296317782e313286ea8686e039d8a96b406c4bc
|
4
|
+
data.tar.gz: ec34593d4e28187ab7d6e9aa45dbf5aa9e5689e2075427034e19738cb70e3357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fbb8bfce7b43df4eafc43933fe88fdaf283940475f3c2b6fb665f8c62d1ce2a044e6938850e10e789b9df757662d8353535411eedf7caa1842d4a1e0c837fff
|
7
|
+
data.tar.gz: 1bb25f41bb89503970202c6169dfeac3c5f7e957fb5227347f8fd0ca665d480f43846205316b1ea21c03cad76241e64a9b7c8681984e225417275000881aff3d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[![Gem Version][GV img]][Gem Version]
|
4
4
|
|
5
|
+
<img src="https://raw.githubusercontent.com/matt-harvey/git_curate/master/assets/demo2.gif" width="1000" alt="Demo" />
|
6
|
+
|
5
7
|
## Motivation
|
6
8
|
|
7
9
|
After a while, my local repo becomes cluttered with branches, and `git branch` outputs an awkwardly
|
@@ -9,9 +11,10 @@ long list. I want to delete some of those branches to bring that list back under
|
|
9
11
|
can't always remember which branches I want to keep from the branch names alone; and inspecting them
|
10
12
|
one at a time and _then_ running `git branch -D` in a separate step, is painful.
|
11
13
|
|
12
|
-
`git curate` is intended to ease this pain. It steps you through the local branches of a repo one at
|
13
|
-
time, outputting a small amount of information about each branch (last commit date, author and
|
14
|
-
summary
|
14
|
+
`git curate` is intended to ease this pain. It steps you through the local branches of a repo one at
|
15
|
+
a time, outputting a small amount of information about each branch (last commit date, author and
|
16
|
+
summary, and whether the branch has been merged into the current HEAD), and prompting you either to
|
17
|
+
keep or to delete each branch as you go.
|
15
18
|
|
16
19
|
## Installation
|
17
20
|
|
@@ -47,7 +50,7 @@ After checking out the repo, run `bin/setup` to install dependencies.
|
|
47
50
|
|
48
51
|
## Contributing
|
49
52
|
|
50
|
-
Bug reports and pull requests are welcome on GitHub
|
53
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/matt-harvey/git_curate).
|
51
54
|
|
52
55
|
## License
|
53
56
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/assets/demo2.gif
ADDED
Binary file
|
data/lib/git_curate.rb
CHANGED
data/lib/git_curate/runner.rb
CHANGED
@@ -8,7 +8,8 @@ module GitCurate
|
|
8
8
|
exit
|
9
9
|
end
|
10
10
|
|
11
|
-
branches =
|
11
|
+
branches = command_to_a("git branch").reject { |b| current_branch?(b) }
|
12
|
+
merged_branches = command_to_a("git branch --merged").reject { |b| current_branch?(b) }.to_set
|
12
13
|
|
13
14
|
table = Tabulo::Table.new(branches, vertical_rule_character: " ", intersection_character: " ",
|
14
15
|
horizontal_rule_character: "-", column_padding: 0) do |t|
|
@@ -26,6 +27,10 @@ module GitCurate
|
|
26
27
|
t.add_column("Last subject", align_header: :left) do |branch|
|
27
28
|
`git log -n1 --format='format:%s' #{branch}`
|
28
29
|
end
|
30
|
+
|
31
|
+
t.add_column("Merged into HEAD?", align_header: :left) do |branch|
|
32
|
+
merged_branches.include?(branch) ? "Merged" : "Not merged"
|
33
|
+
end
|
29
34
|
end
|
30
35
|
|
31
36
|
table.shrinkwrap!(max_table_width: 125)
|
@@ -85,6 +90,12 @@ module GitCurate
|
|
85
90
|
EOL
|
86
91
|
end
|
87
92
|
|
93
|
+
# Runs the passed string command as a system command, gathers any lines of output, stripped of
|
94
|
+
# leading and trailing whitespace, and returns them as an array.
|
95
|
+
def command_to_a(command)
|
96
|
+
`#{command}`.split($/).map(&:strip)
|
97
|
+
end
|
98
|
+
|
88
99
|
end
|
89
100
|
|
90
101
|
end
|
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: 0.
|
4
|
+
version: 0.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:
|
11
|
+
date: 2019-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- README.md
|
98
98
|
- Rakefile
|
99
99
|
- VERSION
|
100
|
+
- assets/demo2.gif
|
100
101
|
- bin/setup
|
101
102
|
- exe/git-curate
|
102
103
|
- git_curate.gemspec
|
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
126
|
version: '0'
|
126
127
|
requirements: []
|
127
128
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.7.6
|
129
130
|
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
summary: Simple git branch curation tool
|