dngg 0.0.5 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dngg.rb +2 -2
- data/lib/dngg/command/finish.rb +4 -4
- data/lib/dngg/command/merge.rb +8 -7
- data/lib/dngg/hook/commit-msg +1 -1
- data/lib/dngg/util/submodule.rb +13 -9
- data/lib/dngg/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46475e5573f76ae8f910ca96f92148c2fd293604f025867361937654e6a3a687
|
4
|
+
data.tar.gz: d7409ea217cb0d13cd383c41147e51f1f993ddcfaa927decc15102dddcc89d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a1e819c468466ffc54df57fe9556e00d1b43ca06fc237eb8f1e67b02e3016f1ffd25cd739d0fa967d95c068a314666d60cbb9f640d7acc9f48c7c97b795387
|
7
|
+
data.tar.gz: 478f40447cd5cde885291b88def7f81baa5d463af8b4e31a4b44c4d7245035b202afba86e2f0b7fc3c5d43c68a8b1355823fae451efe17d1fcc6ad986be14090
|
data/Gemfile.lock
CHANGED
data/lib/dngg.rb
CHANGED
@@ -34,8 +34,8 @@ module DNGG
|
|
34
34
|
start_flow(branch, action)
|
35
35
|
end
|
36
36
|
|
37
|
-
desc 'merge <branch>
|
38
|
-
option :rebase, :default => false, :type => :boolean, aliases: '-r'
|
37
|
+
desc 'merge <branch>', 'Merge,开发完成后执行'
|
38
|
+
# option :rebase, :default => false, :type => :boolean, aliases: '-r'
|
39
39
|
def merge(branch)
|
40
40
|
rebase = options[:rebase]
|
41
41
|
merge_flow(branch, rebase)
|
data/lib/dngg/command/finish.rb
CHANGED
@@ -59,16 +59,16 @@ module DNGG
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
62
|
-
|
63
62
|
whole_files = `git status -s`.split(/\n/).delete_if do |w|
|
64
63
|
w == ''
|
65
64
|
end
|
66
65
|
return '' if whole_files.length != modified.length
|
67
|
-
|
68
66
|
outputs = ''
|
69
67
|
modified.each_with_index do |m, index|
|
70
68
|
msg = get_lastest_msg_of_module(m)
|
71
|
-
|
69
|
+
if msg.index(':')
|
70
|
+
outputs += msg.insert(msg.index(':') + 1, "[#{get_module_name(m)}]")
|
71
|
+
end
|
72
72
|
if index != modified.length - 1
|
73
73
|
outputs += "\n"
|
74
74
|
end
|
@@ -79,7 +79,7 @@ module DNGG
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def get_module_name(module_name)
|
82
|
-
module_name.split(/\//).last
|
82
|
+
module_name.split(/\//).last
|
83
83
|
end
|
84
84
|
|
85
85
|
end
|
data/lib/dngg/command/merge.rb
CHANGED
@@ -29,13 +29,14 @@ module DNGG
|
|
29
29
|
`git fetch | grep 'ignored'`
|
30
30
|
end
|
31
31
|
|
32
|
-
if need_rebase(branch) || force_rebase
|
33
|
-
|
34
|
-
|
35
|
-
else
|
36
|
-
|
37
|
-
|
38
|
-
end
|
32
|
+
# if need_rebase(branch) || force_rebase
|
33
|
+
# process_rebase(arry_conflict, branch)
|
34
|
+
# puts 'Tip: 主工程rebase模式'.blue
|
35
|
+
# else
|
36
|
+
# process_merge(arry_conflict, '主工程', branch)
|
37
|
+
# puts 'Tip: 主工程merge模式'.blue
|
38
|
+
# end
|
39
|
+
process_merge(arry_conflict, '主工程', branch)
|
39
40
|
|
40
41
|
if arry_conflict.size > 0
|
41
42
|
tip = "==> #{arry_conflict.size}个模块冲突:"
|
data/lib/dngg/hook/commit-msg
CHANGED
data/lib/dngg/util/submodule.rb
CHANGED
@@ -16,12 +16,11 @@ module DNGG
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def get_submodule
|
19
|
-
pattern = /(?<=\s)[\/0-9a-zA-Z]*(?=\s)/
|
19
|
+
pattern = /(?<=\s)[\/0-9a-zA-Z\-]*(?=\s)/
|
20
20
|
|
21
21
|
sub_status = `git submodule`
|
22
22
|
sub_status = sub_status.split(/\n/)
|
23
23
|
match = pattern.match(sub_status[0])
|
24
|
-
|
25
24
|
if match==nil
|
26
25
|
puts '==> 初始化子模块'.yellow
|
27
26
|
`git submodule update --init --recursive`
|
@@ -32,6 +31,10 @@ module DNGG
|
|
32
31
|
result = []
|
33
32
|
sub_status.each do |sub|
|
34
33
|
match = pattern.match(sub.strip)
|
34
|
+
unless match
|
35
|
+
puts `pwd`,"====>>>子模块id #{sub}拉取异常!!! 执行 git submodule 检查".red
|
36
|
+
next
|
37
|
+
end
|
35
38
|
result.push(match[0])
|
36
39
|
end
|
37
40
|
result
|
@@ -83,11 +86,11 @@ module DNGG
|
|
83
86
|
def get_submodule_commit
|
84
87
|
sub_tree = 'git ls-tree HEAD | grep "160000"'
|
85
88
|
sub_commits = `#{sub_tree}`
|
86
|
-
if sub_commits.strip == '' && (File.directory? 'submodules')
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
89
|
+
# if sub_commits.strip == '' && (File.directory? 'submodules')
|
90
|
+
# Dir.chdir 'submodules'
|
91
|
+
# sub_commits = `#{sub_tree}`
|
92
|
+
# Dir.chdir '..'
|
93
|
+
# end
|
91
94
|
pattern = /(?<=\s)[0-9a-zA-Z]{40}(?=\s)/
|
92
95
|
sub_commits = sub_commits.split(/\n/)
|
93
96
|
result = []
|
@@ -144,16 +147,17 @@ module DNGG
|
|
144
147
|
get_submodule.include?(module_name)
|
145
148
|
end
|
146
149
|
|
150
|
+
# 寻找上次merge之后的commit消息
|
147
151
|
def get_lastest_msg_not_merge
|
148
152
|
depth = 1
|
149
|
-
while (msg = get_lastest_msg(depth)).start_with?('Merge
|
153
|
+
while (msg = get_lastest_msg(depth)).start_with?('Merge ') do
|
150
154
|
depth += 1
|
151
155
|
end
|
152
156
|
msg
|
153
157
|
end
|
154
158
|
|
155
159
|
def get_lastest_msg(depth)
|
156
|
-
msg = `git log --format=%B -n #{depth}`.split(/\n\n/)
|
160
|
+
msg = `git log --oneline --format=%B -n #{depth}`.split(/\n\n/)
|
157
161
|
msg[depth - 1].strip
|
158
162
|
end
|
159
163
|
|
data/lib/dngg/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module DNGG
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
2
|
+
VERSION = '0.0.9'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dngg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iSnow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|