git_curate 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: 62b82ad94f1a3524028e3e9f8b8dd60f1b4f2177
4
- data.tar.gz: e01c3ba16c3828cdb511f69fea4f042451c851c3
2
+ SHA256:
3
+ metadata.gz: 354154ef2b612e1b4831e2c42296317782e313286ea8686e039d8a96b406c4bc
4
+ data.tar.gz: ec34593d4e28187ab7d6e9aa45dbf5aa9e5689e2075427034e19738cb70e3357
5
5
  SHA512:
6
- metadata.gz: 442a5541be149365e52164ade62f83fef05838baadfc3d34ab5c003963891d3bac2c4bed2c3499e30cdce1a2b8fcdb8f964172ae41228aa0d4af8d99ad153f8d
7
- data.tar.gz: cb8dab16a57aadd7dfbdd009663a9fb1bc6eaa74ece51bd880656fa749814b3df01848a9437eddcd53221fdd423e393cbbfb82fb72942fb82ebe6f5c65eb661f
6
+ metadata.gz: 8fbb8bfce7b43df4eafc43933fe88fdaf283940475f3c2b6fb665f8c62d1ce2a044e6938850e10e789b9df757662d8353535411eedf7caa1842d4a1e0c837fff
7
+ data.tar.gz: 1bb25f41bb89503970202c6169dfeac3c5f7e957fb5227347f8fd0ca665d480f43846205316b1ea21c03cad76241e64a9b7c8681984e225417275000881aff3d
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### v0.3.0
4
+
5
+ * Add "Merged into HEAD?" column.
6
+
3
7
  ### v0.2.0
4
8
 
5
9
  * Make output more compact.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_curate (0.2.0)
4
+ git_curate (0.3.0)
5
5
  highline (= 2.0.0)
6
6
  tabulo (= 1.2.0)
7
7
 
@@ -24,4 +24,4 @@ DEPENDENCIES
24
24
  rake-version (~> 1.0)
25
25
 
26
26
  BUNDLED WITH
27
- 1.16.1
27
+ 1.16.6
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 a
13
- time, outputting a small amount of information about each branch (last commit date, author and
14
- summary), and prompting you either to keep or to delete each branch as you go.
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 at https://github.com/matt-harvey/git_curate.
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.2.0
1
+ 0.3.0
Binary file
@@ -1,4 +1,5 @@
1
1
  require "git_curate/runner"
2
2
  require "git_curate/version"
3
3
  require "highline/import"
4
+ require "set"
4
5
  require "tabulo"
@@ -8,7 +8,8 @@ module GitCurate
8
8
  exit
9
9
  end
10
10
 
11
- branches = `git branch`.split($/).reject { |b| current_branch?(b) }.map(&:strip)
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
@@ -1,3 +1,3 @@
1
1
  module GitCurate
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.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: 0.2.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: 2018-07-16 00:00:00.000000000 Z
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.4.5.1
129
+ rubygems_version: 2.7.6
129
130
  signing_key:
130
131
  specification_version: 4
131
132
  summary: Simple git branch curation tool