dngg 0.0.5 → 0.0.9

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed83c69c8ffd9f281d9bda6d8d0a2534f5f543b80052dc9b445c49a99144ce5d
4
- data.tar.gz: 2406d79be38a740e8ed633c4c89efab8ba1036d524405cdb8972e9a1136a15db
3
+ metadata.gz: 46475e5573f76ae8f910ca96f92148c2fd293604f025867361937654e6a3a687
4
+ data.tar.gz: d7409ea217cb0d13cd383c41147e51f1f993ddcfaa927decc15102dddcc89d92
5
5
  SHA512:
6
- metadata.gz: cc0258704a57f9703daf63be525ca98f7b8065c4c392cbcd8814972116b5d9542439b829579011c3436da2d273830ad4eda4e236a0eaa686e72450af35301d21
7
- data.tar.gz: df102c00a4c7b29081032559a9797f6f03a75d4226af1f71841c082f3c3f9ce9da4ccd61d077864f8a9533bbb4eb5ea8e7a09561bfb068e0e0833e0c4e2616ce
6
+ metadata.gz: d8a1e819c468466ffc54df57fe9556e00d1b43ca06fc237eb8f1e67b02e3016f1ffd25cd739d0fa967d95c068a314666d60cbb9f640d7acc9f48c7c97b795387
7
+ data.tar.gz: 478f40447cd5cde885291b88def7f81baa5d463af8b4e31a4b44c4d7245035b202afba86e2f0b7fc3c5d43c68a8b1355823fae451efe17d1fcc6ad986be14090
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dngg (0.0.5)
4
+ dngg (0.0.9)
5
5
  colorize (= 0.8.1)
6
6
  oj (= 3.8.0)
7
7
  thor (= 1.0.0)
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> [-r|--rebase]', 'Merge,开发完成后执行; -r:主工程强制rebase'
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)
@@ -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
- outputs += msg.insert(msg.index(':') + 1, "[#{get_module_name(m)}]")
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.downcase
82
+ module_name.split(/\//).last
83
83
  end
84
84
 
85
85
  end
@@ -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
- 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
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}个模块冲突:"
@@ -8,7 +8,7 @@ def commit_check
8
8
  standards.each do |standard|
9
9
  check(standard)
10
10
  end
11
- puts '====> commit message不符合规范,请查看规范'.red
11
+ puts '====> commit message不符合规范,请查看规范 https://naxg5qz90v.feishu.cn/wiki/wikcnGAC0ayqRw5SSyj6QFQESKb'.red
12
12
  exit 1
13
13
  end
14
14
 
@@ -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
- Dir.chdir 'submodules'
88
- sub_commits = `#{sub_tree}`
89
- Dir.chdir '..'
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 branch') do
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.5'
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.5
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-07-27 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor