git-visualiser 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2MzY2JlMjk3MjBhYzQ5ODU0ZWYzZmVhMjZmNGM1YmIzN2VjMGVlZQ==
4
+ ODg1MWRlNWQwZmI1ZWZmMjMxNWQ0MTk1MjA1YTYyMWFiNzRlYTk5Ng==
5
5
  data.tar.gz: !binary |-
6
- YzYyOGI0ZWM5YmZiOWJlYThjNWVmNDdmYjEzZWMzYjMzYjQ1OGUzOQ==
6
+ OTgyYzIyMjAxMjIzMjg0YWU1ZDNjZjRkOWYzNjVlOTBiMmE0ZDNjMQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- N2VmZWIxNjI2ZjczZTJlYzRlMWY0YzIwMGRiNTk0NDE4NjY2NjUwMzc1OGFm
10
- YzExYzE1N2NhNWM2YjNkOWZkMTIxZjZlMTI5ZThhNTAwYTFhZWY4ZDE0ZjU0
11
- OGJlOWJkM2VhMzUwNDg5YjgyMDQ5M2RmOGQyYzEwNWRiYjNiZDA=
9
+ NWZjYjhmZTlhNTlkYzM4ODA4ZGI1NDc2ODliYTFmYjYwZmQwMTliZDg4MzU0
10
+ OTFjNDg0ODBhZWY5OTU5NDFhYmUwM2Q5YzBmNTY5ZGJlY2Y5NzM4MmQ2ZGE3
11
+ NTYzYTlmMDJjMzlkMjdiMGVkNTk4OWYwYjdhMjJhZjc2ZThlYjA=
12
12
  data.tar.gz: !binary |-
13
- ZGY1OTk0NDdlZTY4MmI2NjNjZWI5ZTE0NDU0OWU5NGEwNDhiOTVlNGY0N2Ew
14
- ZGMzNmVlMTJkMDA0ODdhOTgyNjRkMmFmNTVhZTk1ZDgyZTRiNTc2MzZiYTM3
15
- NzM2ZmQyZGYwZmRmZjkzN2IxYzNjZjM1NjQxYWFjZDliODVkODM=
13
+ MTYxNTVlZGUyYjk5ZjYwMzY0Y2U4YmZmYzU0Yjc3M2Q2NGM4ZGQ5YzViMTU5
14
+ NDRlOTM4NjkyOTljYWIwMmVhNDdkZDU0ZTkzZjU3ODEwMDA1MmQ2ODM1MWQ5
15
+ ZGRiMDI5NmE3NjkxZGRhODI2NjI2MmUzMTM0NWFhYjYxYmI3YWQ=
@@ -7,6 +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
11
  diff = Visualisation.branch_diff_size(branch)
11
12
  head_commit = Visualisation.head_commit_sha(branch)
12
13
  merged_with_master = Visualisation.branch_contains_commit("master", head_commit)
@@ -21,8 +22,7 @@ module Visualisation
21
22
  end
22
23
 
23
24
  def self.branches_with_remotes
24
- `git branch -a`.split("\n").each { |b| b.gsub!(/[*]?\s/, '') and b.gsub!(/remotes\//, '') }
25
- .delete_if { |b| b.include?('->') }
25
+ `git branch -a`.split("\n").each { |b| b.gsub!(/[*]?\s/, '') and b.gsub!(/remotes\//, '') }.delete_if { |b| b.include?('->') }
26
26
  end
27
27
 
28
28
  def self.remotes
@@ -60,15 +60,19 @@ module Visualisation
60
60
 
61
61
  def self.repo_branches_merged(show_remotes = true)
62
62
  merged_branches = {}
63
+ checked_branches = []
63
64
  compare_branches = branches_with_remotes
64
- compare_branches.each do |b1|
65
+ compare_branches.each_with_index do |b1, i|
65
66
  b1_merges = {}
66
- compare_branches.each do |b2|
67
- next if b1 == b2 || b2.split("/").last == b1 ||
67
+ compare_branches.each_with_index do |b2, j|
68
+ next if i == j || b2.split("/").last == b1 ||
68
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}"
69
72
  directions = {}
70
73
  directions.merge!(:left => true) if branch_merged_with_base?(b1, b2, remotes)
71
74
  directions.merge!(:right => true) if right = branch_merged_with_base?(b2, b1, remotes)
75
+
72
76
  b1_merges.merge!(b2.to_sym => directions)
73
77
  end
74
78
  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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James McCann