dngg 0.0.5 → 0.0.6
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/command/finish.rb +4 -4
- data/lib/dngg/hook/commit-msg +1 -1
- data/lib/dngg/util/submodule.rb +8 -7
- 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: 2ecfeb442ed96915e6fdc9101590f01e2efe062593976b072cf298319781a9d7
|
4
|
+
data.tar.gz: 7a74ad2ec1d7ec59b18696ca68f8e01f3cf435e9fad1d38e8db0e18eac42a60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae5244fd440c15209f5e0d40c8a77ad4c87a4e12aeae9cbcac792fa7f3846e6f2ec83589dbab9fbd6003eb1a4e3c08073b95d802c0193f3a9cc11245e65ee73b
|
7
|
+
data.tar.gz: 4d9bfb71b7254a58483437faf444b66efc39cc6ff3b66c14bf423a2615c3da27d697c5272cba80ac397b850d5d745afdda34a9dd3807773fb5dc7e9018e8ef64
|
data/Gemfile.lock
CHANGED
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/hook/commit-msg
CHANGED
data/lib/dngg/util/submodule.rb
CHANGED
@@ -83,11 +83,11 @@ module DNGG
|
|
83
83
|
def get_submodule_commit
|
84
84
|
sub_tree = 'git ls-tree HEAD | grep "160000"'
|
85
85
|
sub_commits = `#{sub_tree}`
|
86
|
-
if sub_commits.strip == '' && (File.directory? 'submodules')
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
86
|
+
# if sub_commits.strip == '' && (File.directory? 'submodules')
|
87
|
+
# Dir.chdir 'submodules'
|
88
|
+
# sub_commits = `#{sub_tree}`
|
89
|
+
# Dir.chdir '..'
|
90
|
+
# end
|
91
91
|
pattern = /(?<=\s)[0-9a-zA-Z]{40}(?=\s)/
|
92
92
|
sub_commits = sub_commits.split(/\n/)
|
93
93
|
result = []
|
@@ -144,16 +144,17 @@ module DNGG
|
|
144
144
|
get_submodule.include?(module_name)
|
145
145
|
end
|
146
146
|
|
147
|
+
# 寻找上次merge之后的commit消息
|
147
148
|
def get_lastest_msg_not_merge
|
148
149
|
depth = 1
|
149
|
-
while (msg = get_lastest_msg(depth)).start_with?('Merge
|
150
|
+
while (msg = get_lastest_msg(depth)).start_with?('Merge ') do
|
150
151
|
depth += 1
|
151
152
|
end
|
152
153
|
msg
|
153
154
|
end
|
154
155
|
|
155
156
|
def get_lastest_msg(depth)
|
156
|
-
msg = `git log --format=%B -n #{depth}`.split(/\n\n/)
|
157
|
+
msg = `git log --oneline --format=%B -n #{depth}`.split(/\n\n/)
|
157
158
|
msg[depth - 1].strip
|
158
159
|
end
|
159
160
|
|
data/lib/dngg/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module DNGG
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
2
|
+
VERSION = '0.0.6'
|
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.6
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|