github_branch_list 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/bin/{gbl → github_branch_list} +19 -6
  3. metadata +24 -24
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
@@ -5,12 +5,16 @@ require 'yaml'
5
5
 
6
6
  options = {}
7
7
  OptionParser.new do |opts|
8
- opts.banner = "Usage: ghl [options]"
8
+ opts.banner = "Usage: github_branch_list [options]"
9
9
 
10
10
  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|
15
+ options[:to_delete_with_proposal] = 1
16
+ end
17
+
14
18
  opts.on("-v", "--version", "Version") do |v|
15
19
  options[:version] = 1
16
20
  end
@@ -21,7 +25,7 @@ end.parse!
21
25
  #p ARGV
22
26
 
23
27
  if options.include? :version
24
- puts "0.3.0"
28
+ puts "0.4.0"
25
29
  exit
26
30
  end
27
31
 
@@ -46,19 +50,28 @@ def diff_branches br1, br2, options
46
50
  behind = `git rev-list #{br2}..#{br1} | wc -l`.strip
47
51
 
48
52
  display = true
49
- if options.include?(:to_delete) && (ahead.to_i != 0)
50
- display = false
51
- end
53
+ if (options.include?(:to_delete) || options.include?(:to_delete_with_proposal)) && (ahead.to_i != 0)
54
+ display = false
55
+ end
52
56
 
53
57
  if display == true
58
+ puts
54
59
  puts "#{name2} from #{name1} is #{ahead} ahead "
55
60
  puts "#{name2} from #{name1} is #{behind} behind "
56
- puts
61
+ if options.include?(:to_delete_with_proposal)
62
+ puts "Do you want to delete the remote branch #{name2}? [y/N]"
63
+ r = STDIN.gets
64
+ if r.strip == "y"
65
+ `git push origin :#{name2}`
66
+ end
67
+ end
68
+
57
69
  end
58
70
 
59
71
  end
60
72
 
61
73
  def diff_all_branhces_with_master options
74
+ `git fetch origin`
62
75
  branches = remote_branches
63
76
  branches.each do |br|
64
77
  diff_branches "origin/master", br, 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: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Caccinolo Benoit
@@ -15,12 +15,13 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-15 00:00:00 +02:00
19
- default_executable: gbl
18
+ date: 2011-08-01 00:00:00 +02:00
19
+ default_executable: github_branch_list
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: shoulda
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ type: :development
24
+ requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
27
  - - ">="
@@ -29,12 +30,12 @@ dependencies:
29
30
  segments:
30
31
  - 0
31
32
  version: "0"
33
+ version_requirements: *id001
34
+ name: shoulda
35
+ - !ruby/object:Gem::Dependency
32
36
  prerelease: false
33
37
  type: :development
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: bundler
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
38
39
  none: false
39
40
  requirements:
40
41
  - - ~>
@@ -45,12 +46,12 @@ dependencies:
45
46
  - 0
46
47
  - 0
47
48
  version: 1.0.0
49
+ version_requirements: *id002
50
+ name: bundler
51
+ - !ruby/object:Gem::Dependency
48
52
  prerelease: false
49
53
  type: :development
50
- requirement: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: jeweler
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
54
55
  none: false
55
56
  requirements:
56
57
  - - ~>
@@ -61,12 +62,12 @@ dependencies:
61
62
  - 5
62
63
  - 2
63
64
  version: 1.5.2
65
+ version_requirements: *id003
66
+ name: jeweler
67
+ - !ruby/object:Gem::Dependency
64
68
  prerelease: false
65
69
  type: :development
66
- requirement: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: rcov
69
- version_requirements: &id004 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
70
71
  none: false
71
72
  requirements:
72
73
  - - ">="
@@ -75,13 +76,12 @@ dependencies:
75
76
  segments:
76
77
  - 0
77
78
  version: "0"
78
- prerelease: false
79
- type: :development
80
- requirement: *id004
79
+ version_requirements: *id004
80
+ name: rcov
81
81
  description: a gem to have the same output as the github branch list page
82
82
  email: benoit.caccinolo@gmail.com
83
83
  executables:
84
- - gbl
84
+ - github_branch_list
85
85
  extensions: []
86
86
 
87
87
  extra_rdoc_files:
@@ -97,7 +97,7 @@ files:
97
97
  - README.rdoc
98
98
  - Rakefile
99
99
  - VERSION
100
- - bin/gbl
100
+ - bin/github_branch_list
101
101
  - lib/github_branch_list.rb
102
102
  - test/helper.rb
103
103
  - test/test_github_branch_list.rb