git-visualiser 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/application/visualisation.rb +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODg1MWRlNWQwZmI1ZWZmMjMxNWQ0MTk1MjA1YTYyMWFiNzRlYTk5Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTgyYzIyMjAxMjIzMjg0YWU1ZDNjZjRkOWYzNjVlOTBiMmE0ZDNjMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWZjYjhmZTlhNTlkYzM4ODA4ZGI1NDc2ODliYTFmYjYwZmQwMTliZDg4MzU0
|
10
|
+
OTFjNDg0ODBhZWY5OTU5NDFhYmUwM2Q5YzBmNTY5ZGJlY2Y5NzM4MmQ2ZGE3
|
11
|
+
NTYzYTlmMDJjMzlkMjdiMGVkNTk4OWYwYjdhMjJhZjc2ZThlYjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
65
|
+
compare_branches.each_with_index do |b1, i|
|
65
66
|
b1_merges = {}
|
66
|
-
compare_branches.
|
67
|
-
next if
|
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)
|