git-visualiser 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODg1MWRlNWQwZmI1ZWZmMjMxNWQ0MTk1MjA1YTYyMWFiNzRlYTk5Ng==
4
+ NTU1YTFlNmRmZjg1ZDVlZjViODI3Nzk5YzM5NzAyZjFiYzY3YWMzNA==
5
5
  data.tar.gz: !binary |-
6
- OTgyYzIyMjAxMjIzMjg0YWU1ZDNjZjRkOWYzNjVlOTBiMmE0ZDNjMQ==
6
+ NTliMWUzMTZkM2FhNzIwZTE1ZDUzZTI1ZDhkYjQ3ZDFkMmY2NzhjYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWZjYjhmZTlhNTlkYzM4ODA4ZGI1NDc2ODliYTFmYjYwZmQwMTliZDg4MzU0
10
- OTFjNDg0ODBhZWY5OTU5NDFhYmUwM2Q5YzBmNTY5ZGJlY2Y5NzM4MmQ2ZGE3
11
- NTYzYTlmMDJjMzlkMjdiMGVkNTk4OWYwYjdhMjJhZjc2ZThlYjA=
9
+ NDdiMWJjMzI4M2FkM2YzYmQxM2YxM2VjYmI0MTYxMGJhZTc1NDNkODY4NTg5
10
+ ZGE1ODA1NTY3NDQ0N2ZlNTlhNGY5ZGQ5NmVlMzZhOWNlMzA0Y2E0YjQ4MzQ4
11
+ NzhjMGY5ZjI1YzU3YzVmZDJmNGYwYjFlMmJiMzQzOWMwZWU4ZGQ=
12
12
  data.tar.gz: !binary |-
13
- MTYxNTVlZGUyYjk5ZjYwMzY0Y2U4YmZmYzU0Yjc3M2Q2NGM4ZGQ5YzViMTU5
14
- NDRlOTM4NjkyOTljYWIwMmVhNDdkZDU0ZTkzZjU3ODEwMDA1MmQ2ODM1MWQ5
15
- ZGRiMDI5NmE3NjkxZGRhODI2NjI2MmUzMTM0NWFhYjYxYmI3YWQ=
13
+ N2Q4ZTlkNDc4NDJhYjQxNTBlZGU3ODViMTE3NjczNzI5ZDk5Mzk1NTFhZTFm
14
+ NjcyYzIzMzE0YzRjZWQxZTMzZDE2M2RkZWYzODRlN2UzNjQ3MmQzNjA3ZTBi
15
+ NzU1NmFmMjhjMmQzZmZmMGY5MjZkZDRmODNhMDJmYzRkZTU2MzE=
@@ -7,7 +7,7 @@ module Visualisation
7
7
  total_additions = total_deletions = 0
8
8
  remotes_arr = Visualisation.remotes
9
9
  Visualisation.branches_with_remotes.each do |branch|
10
- # puts "branch: #{branch}"
10
+ puts "#{branch}"
11
11
  diff = Visualisation.branch_diff_size(branch)
12
12
  head_commit = Visualisation.head_commit_sha(branch)
13
13
  merged_with_master = Visualisation.branch_contains_commit("master", head_commit)
@@ -22,7 +22,8 @@ module Visualisation
22
22
  end
23
23
 
24
24
  def self.branches_with_remotes
25
- `git branch -a`.split("\n").each { |b| b.gsub!(/[*]?\s/, '') and b.gsub!(/remotes\//, '') }.delete_if { |b| b.include?('->') }
25
+ `git branch -a`.split("\n").each { |b| b.gsub!(/[*]?\s/, '') and b.gsub!(/remotes\//, '') }
26
+ .delete_if { |b| b.include?('->') }
26
27
  end
27
28
 
28
29
  def self.remotes
@@ -60,19 +61,16 @@ module Visualisation
60
61
 
61
62
  def self.repo_branches_merged(show_remotes = true)
62
63
  merged_branches = {}
63
- checked_branches = []
64
64
  compare_branches = branches_with_remotes
65
- compare_branches.each_with_index do |b1, i|
65
+ compare_branches.each do |b1|
66
66
  b1_merges = {}
67
- compare_branches.each_with_index do |b2, j|
68
- next if i == j || b2.split("/").last == b1 ||
67
+ compare_branches.each do |b2|
68
+ next if b1 == b2 || b2.split("/").last == b1 ||
69
69
  (merged_branches.has_key?(b2.to_sym) && merged_branches[b2.to_sym].has_key?(b1.to_sym))
70
- # (checked_branches[i] && checked_branches[i].include?(j)
71
- # puts "comparing branches #{b1} and #{b2}"
72
70
  directions = {}
71
+ puts "comparing #{b1} with #{b2}"
73
72
  directions.merge!(:left => true) if branch_merged_with_base?(b1, b2, remotes)
74
73
  directions.merge!(:right => true) if right = branch_merged_with_base?(b2, b1, remotes)
75
-
76
74
  b1_merges.merge!(b2.to_sym => directions)
77
75
  end
78
76
  merged_branches.merge!(b1.to_sym => b1_merges)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-visualiser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James McCann