github_branch_list 0.4.0 → 0.5.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.
- data/VERSION +1 -1
- data/bin/github_branch_list +31 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/bin/github_branch_list
CHANGED
@@ -25,13 +25,17 @@ end.parse!
|
|
25
25
|
#p ARGV
|
26
26
|
|
27
27
|
if options.include? :version
|
28
|
-
puts "0.
|
28
|
+
puts "0.5.0"
|
29
29
|
exit
|
30
30
|
end
|
31
31
|
|
32
|
-
def remote_branches
|
32
|
+
def remote_branches remotes=false
|
33
33
|
branches = []
|
34
|
-
|
34
|
+
if remotes
|
35
|
+
output = `git branch -r`
|
36
|
+
else
|
37
|
+
output = `git branch`
|
38
|
+
end
|
35
39
|
output.each_line do |line|
|
36
40
|
branches << line.strip
|
37
41
|
end
|
@@ -44,6 +48,7 @@ def diff_branches br1, br2, options
|
|
44
48
|
name1 = br1.gsub /origin\//, ""
|
45
49
|
name2 = br2.gsub /origin\//, ""
|
46
50
|
|
51
|
+
|
47
52
|
return if name1 == name2
|
48
53
|
|
49
54
|
ahead = `git rev-list #{br1}..#{br2} | wc -l`.strip
|
@@ -62,7 +67,11 @@ def diff_branches br1, br2, options
|
|
62
67
|
puts "Do you want to delete the remote branch #{name2}? [y/N]"
|
63
68
|
r = STDIN.gets
|
64
69
|
if r.strip == "y"
|
65
|
-
|
70
|
+
if options[:remote]
|
71
|
+
`git push origin :#{name2}`
|
72
|
+
else
|
73
|
+
`git br -D #{name2}`
|
74
|
+
end
|
66
75
|
end
|
67
76
|
end
|
68
77
|
|
@@ -72,10 +81,27 @@ end
|
|
72
81
|
|
73
82
|
def diff_all_branhces_with_master options
|
74
83
|
`git fetch origin`
|
75
|
-
|
84
|
+
|
85
|
+
options[:remote] = true
|
86
|
+
title_block "REMOTE BRANCHES"
|
87
|
+
branches = remote_branches(options[:remote])
|
76
88
|
branches.each do |br|
|
77
89
|
diff_branches "origin/master", br, options
|
78
90
|
end
|
91
|
+
|
92
|
+
options[:remote] = false
|
93
|
+
title_block "LOCAL BRANCHES"
|
94
|
+
branches = remote_branches(options[:remote])
|
95
|
+
branches.each do |br|
|
96
|
+
diff_branches "origin/master", br, options
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def title_block text=""
|
101
|
+
puts
|
102
|
+
puts "========================================"
|
103
|
+
puts text
|
104
|
+
puts "========================================"
|
79
105
|
end
|
80
106
|
|
81
107
|
diff_all_branhces_with_master options
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_branch_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Caccinolo Benoit
|