socialcast-git-extensions 0.5.0 → 0.6.1
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/VERSION +1 -1
- data/bin/git-prune-merged +35 -0
- data/socialcast-git-extensions.gemspec +3 -2
- metadata +6 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.1
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#prune branches that have been merged into master from the repo
|
4
|
+
#usage -r --remote to prune remote branches
|
5
|
+
|
6
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb')
|
7
|
+
include Socialcast
|
8
|
+
|
9
|
+
remote = ARGV.delete("--remote") || ARGV.delete("-r")
|
10
|
+
|
11
|
+
run_cmd "git checkout master"
|
12
|
+
run_cmd "git pull"
|
13
|
+
|
14
|
+
def each_branch(options = {}, &block)
|
15
|
+
reserved_branches = %w{ HEAD master last_known_good_master staging last_known_good_staging next_release last_known_good_next_release }
|
16
|
+
args = []
|
17
|
+
args << '-r' if options[:remote]
|
18
|
+
args << '--merged'
|
19
|
+
branches = `git branch #{args.join(' ')}`.split("\n")
|
20
|
+
branches.each do |branch|
|
21
|
+
branch = branch.gsub(/\*/, '').strip.split(' ').first
|
22
|
+
branch = branch.split('/').last if options[:remote]
|
23
|
+
yield(branch) unless reserved_branches.include?(branch)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
each_branch do |branch|
|
28
|
+
run_cmd "git branch -d #{branch}"
|
29
|
+
end
|
30
|
+
|
31
|
+
if remote
|
32
|
+
each_branch :remote => true do |branch|
|
33
|
+
run_cmd "grb rm #{branch}"
|
34
|
+
end
|
35
|
+
end
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{socialcast-git-extensions}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ryan Sonnek"]
|
12
12
|
s.date = %q{2010-07-02}
|
13
13
|
s.description = %q{git extension scripts for socialcast workflow}
|
14
14
|
s.email = %q{ryan@socialcast.com}
|
15
|
-
s.executables = ["git-integrate", "git-promote", "git-release", "git-wtf"]
|
15
|
+
s.executables = ["git-integrate", "git-promote", "git-prune-merged", "git-release", "git-wtf"]
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE",
|
18
18
|
"README.rdoc"
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"VERSION",
|
27
27
|
"bin/git-integrate",
|
28
28
|
"bin/git-promote",
|
29
|
+
"bin/git-prune-merged",
|
29
30
|
"bin/git-release",
|
30
31
|
"bin/git-wtf",
|
31
32
|
"lib/socialcast-git-extensions.rb",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast-git-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 1
|
10
|
+
version: 0.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|
@@ -107,6 +107,7 @@ email: ryan@socialcast.com
|
|
107
107
|
executables:
|
108
108
|
- git-integrate
|
109
109
|
- git-promote
|
110
|
+
- git-prune-merged
|
110
111
|
- git-release
|
111
112
|
- git-wtf
|
112
113
|
extensions: []
|
@@ -123,6 +124,7 @@ files:
|
|
123
124
|
- VERSION
|
124
125
|
- bin/git-integrate
|
125
126
|
- bin/git-promote
|
127
|
+
- bin/git-prune-merged
|
126
128
|
- bin/git-release
|
127
129
|
- bin/git-wtf
|
128
130
|
- lib/socialcast-git-extensions.rb
|