github_branch_list 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/github_branch_list +29 -12
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -11,16 +11,29 @@ opts.on("-d", "--to-delete", "Only display branches to delete") do |v|
11
11
  options[:to_delete] = 1
12
12
  end
13
13
 
14
- opts.on("-D", "--to-delete-with-proposel", "Display branches to delete and propose to remove them one by one") do |v|
14
+ opts.on("-D", "--to-delete-with-proposal", "Display branches to delete and propose to remove them one by one") do |v|
15
15
  options[:to_delete_with_proposal] = 1
16
16
  end
17
17
 
18
+ opts.on("-L", "--just-local", "Only treat local branches") do |v|
19
+ options[:just_local_branches] = 1
20
+ end
21
+
22
+ opts.on("-R", "--just-remote", "Only treat remote branches") do |v|
23
+ options[:just_remote_branches] = 1
24
+ end
25
+
18
26
  opts.on("-v", "--version", "Version") do |v|
19
27
  options[:version] = 1
20
28
  end
21
29
 
22
30
  end.parse!
23
31
 
32
+ unless options.include?(:just_local_branches) || options.include?(:just_remote_branches)
33
+ options[:just_local_branches] = true
34
+ options[:just_remote_branches] = true
35
+ end
36
+
24
37
  #p options
25
38
  #p ARGV
26
39
 
@@ -37,7 +50,7 @@ def remote_branches remotes=false
37
50
  output = `git branch`
38
51
  end
39
52
  output.each_line do |line|
40
- branches << line.strip
53
+ branches << line.strip.gsub(/\* /,"")
41
54
  end
42
55
  branches.delete_at(0)
43
56
  branches
@@ -82,19 +95,23 @@ end
82
95
  def diff_all_branhces_with_master options
83
96
  `git fetch origin`
84
97
 
85
- options[:remote] = true
86
- title_block "REMOTE BRANCHES"
87
- branches = remote_branches(options[:remote])
88
- branches.each do |br|
89
- diff_branches "origin/master", br, options
98
+ if options[:just_remote_branches]
99
+ title_block "REMOTE BRANCHES"
100
+ branches = remote_branches(true)
101
+ branches.each do |br|
102
+ diff_branches "origin/master", br, options
103
+ end
90
104
  end
91
105
 
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
106
+ if options[:just_local_branches]
107
+ options[:remote] = false
108
+ title_block "LOCAL BRANCHES"
109
+ branches = remote_branches(false)
110
+ branches.each do |br|
111
+ diff_branches "origin/master", br, options
112
+ end
97
113
  end
114
+
98
115
  end
99
116
 
100
117
  def title_block text=""
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: 11
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 0.5.0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Caccinolo Benoit