git-cleanup 0.1.1 → 0.1.2
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.
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/Rakefile +2 -19
- data/VERSION +1 -1
- data/git-cleanup.gemspec +20 -0
- data/lib/git-cleanup.rb +5 -0
- data/lib/git-cleanup/branch.rb +4 -0
- metadata +23 -14
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,19 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "git-cleanup"
|
8
|
-
gem.summary = %Q{Simplify cleaning up old git branches}
|
9
|
-
gem.description = %Q{Simplify cleaning up old git branches}
|
10
|
-
gem.email = "me@mloughran.com"
|
11
|
-
gem.homepage = "http://github.com/mloughran/git-cleanup"
|
12
|
-
gem.authors = ["Martyn Loughran"]
|
13
|
-
gem.add_dependency 'grit', '~> 2.2.0'
|
14
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
-
end
|
16
|
-
Jeweler::GemcutterTasks.new
|
17
|
-
rescue LoadError
|
18
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/git-cleanup.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "git-cleanup"
|
6
|
+
s.version = "0.1.2"
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["Martyn Loughran"]
|
9
|
+
s.email = ["me@mloughran.com"]
|
10
|
+
s.homepage = "http://github.com/mloughran/git-cleanup"
|
11
|
+
s.summary = %q{Command line tool for interactively cleaning up old git branches (remotely and locally)}
|
12
|
+
s.description = %q{Command line tool for interactively cleaning up old git branches (remotely and locally)}
|
13
|
+
|
14
|
+
s.add_dependency 'grit', '~> 2.2.0'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
end
|
data/lib/git-cleanup.rb
CHANGED
@@ -16,13 +16,18 @@ class GitCleanup
|
|
16
16
|
remote_branches = Branch.remote(repo).select { |b| b.commit.lazy_source }
|
17
17
|
|
18
18
|
remote_branches.sort.each_with_index do |branch, index|
|
19
|
+
next if branch.name == 'master'
|
20
|
+
|
19
21
|
# Diff of commit in branch which is not in master
|
20
22
|
diff = branch.diff(master)
|
23
|
+
commits = branch.commits(master)
|
21
24
|
|
22
25
|
msg = "Branch #{branch.to_s} (#{index+1}/#{remote_branches.size})"
|
23
26
|
puts
|
24
27
|
puts msg
|
25
28
|
puts '-' * msg.size
|
29
|
+
puts "Latest commits:\n"
|
30
|
+
puts commits
|
26
31
|
|
27
32
|
if diff.empty?
|
28
33
|
last_commit = branch.commit
|
data/lib/git-cleanup/branch.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-cleanup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Martyn Loughran
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
18
|
+
date: 2011-02-15 00:00:00 +00:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: grit
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ~>
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
27
30
|
segments:
|
28
31
|
- 2
|
29
32
|
- 2
|
@@ -31,23 +34,25 @@ dependencies:
|
|
31
34
|
version: 2.2.0
|
32
35
|
type: :runtime
|
33
36
|
version_requirements: *id001
|
34
|
-
description:
|
35
|
-
email:
|
37
|
+
description: Command line tool for interactively cleaning up old git branches (remotely and locally)
|
38
|
+
email:
|
39
|
+
- me@mloughran.com
|
36
40
|
executables:
|
37
41
|
- git-cleanup
|
38
42
|
extensions: []
|
39
43
|
|
40
|
-
extra_rdoc_files:
|
41
|
-
|
42
|
-
- README.rdoc
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
43
46
|
files:
|
44
47
|
- .document
|
45
48
|
- .gitignore
|
49
|
+
- Gemfile
|
46
50
|
- LICENSE
|
47
51
|
- README.rdoc
|
48
52
|
- Rakefile
|
49
53
|
- VERSION
|
50
54
|
- bin/git-cleanup
|
55
|
+
- git-cleanup.gemspec
|
51
56
|
- lib/git-cleanup.rb
|
52
57
|
- lib/git-cleanup/branch.rb
|
53
58
|
- lib/git-cleanup/helper.rb
|
@@ -56,30 +61,34 @@ homepage: http://github.com/mloughran/git-cleanup
|
|
56
61
|
licenses: []
|
57
62
|
|
58
63
|
post_install_message:
|
59
|
-
rdoc_options:
|
60
|
-
|
64
|
+
rdoc_options: []
|
65
|
+
|
61
66
|
require_paths:
|
62
67
|
- lib
|
63
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
64
70
|
requirements:
|
65
71
|
- - ">="
|
66
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
67
74
|
segments:
|
68
75
|
- 0
|
69
76
|
version: "0"
|
70
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
71
79
|
requirements:
|
72
80
|
- - ">="
|
73
81
|
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
74
83
|
segments:
|
75
84
|
- 0
|
76
85
|
version: "0"
|
77
86
|
requirements: []
|
78
87
|
|
79
88
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.
|
89
|
+
rubygems_version: 1.4.1
|
81
90
|
signing_key:
|
82
91
|
specification_version: 3
|
83
|
-
summary:
|
92
|
+
summary: Command line tool for interactively cleaning up old git branches (remotely and locally)
|
84
93
|
test_files: []
|
85
94
|
|