vcs2json 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vcs2json/git.rb +8 -5
- data/lib/vcs2json/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1628d43fb23f825bd38e025c470b378796d9f11c
|
4
|
+
data.tar.gz: a5e7a884bcdfda60a5c94816a0fadc603c3106fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68392b573648d1db85febda70a0ee76443d0e678d0d9193997f750172412ee1db3e7023bef4b9a2ffa45c2911be0e1d01c6d67915944975b5f87597f6fef321
|
7
|
+
data.tar.gz: 4539de79de6ce53973205dcd05c42065b21607fe74b2d0b3162790519a4520214a5c8c2686970c1454221e4689ab1787523d3e8451672fff59413bdf447fb1e0
|
data/lib/vcs2json/git.rb
CHANGED
@@ -91,7 +91,8 @@ module Vcs2Json
|
|
91
91
|
commit_ids.each do |id|
|
92
92
|
logger.debug "Parsing commit: #{id}"
|
93
93
|
# get the changed files
|
94
|
-
changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n")
|
94
|
+
changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n")
|
95
|
+
.map {|line| line.split(/(^[AMD])\s+/).delete_if {|e| e.empty?}}
|
95
96
|
|
96
97
|
# remove ignored files
|
97
98
|
changed_files.reject! {|file|
|
@@ -157,15 +158,17 @@ module Vcs2Json
|
|
157
158
|
|
158
159
|
|
159
160
|
changed_files.each_with_index do |(status,file_name),index|
|
160
|
-
|
161
|
-
if
|
161
|
+
STDERR.print "Parsing file #{index+1} Of #{changed_files.size} in commit #{commit_counter+1} of #{self.number} \r"
|
162
|
+
if ([status,file_name].empty? | status.nil? | status.empty? | file_name.nil? | file_name.empty?)
|
163
|
+
# ignoring commit
|
164
|
+
else
|
162
165
|
# add finer grained change info
|
163
166
|
if self.fine_grained
|
164
167
|
begin
|
165
168
|
# new file, all methods are new, no need to calculate diff
|
166
169
|
if status == 'A'
|
167
170
|
SrcML.methods(file_name,revision: id).keys.each {|m| output_hash[:changes] << m}
|
168
|
-
|
171
|
+
# calculate diffs
|
169
172
|
else
|
170
173
|
SrcML.changed_methods_git(file_name,id).each {|m| output_hash[:changes] << m}
|
171
174
|
end
|
@@ -178,7 +181,7 @@ module Vcs2Json
|
|
178
181
|
end
|
179
182
|
end # changes_files.each
|
180
183
|
|
181
|
-
# Only add commits where at least
|
184
|
+
# Only add commits where at least one change was detected
|
182
185
|
if !output_hash[:changes].empty?
|
183
186
|
###########################
|
184
187
|
# PRINT COMMIT TO $stdout #
|
data/lib/vcs2json/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcs2json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Rolfsnes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|