git-commits-analyzer 1.1.0 → 1.2.0
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 +4 -4
- data/lib/git-commits-analyzer/monkey-patch-git.rb +26 -0
- data/lib/git-commits-analyzer.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fba38fa80ebdeaa32450ec16361129f8bf62aca2
|
4
|
+
data.tar.gz: d8f3f72235347742216c3f92536e38d2774962ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 478d2f2b5c6950f6d40fd14f98644bee2b58fae0226c9aa680d4b1fc01e0aeee887cfb58c5baf4565d0393bafaf9cf426d7878616896ad8038cb1b231ab38152
|
7
|
+
data.tar.gz: 66860613cc68cd3dbdb7a557419f6fd0792a10aa0510aef717c08009fdc064d4198e9c31c6b9e3d9919b57dd6370aec2a78e59ae1d1cd51bdf88bfbdb4746ff7
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# The git gem doesn't currently support commits adding submodules when running
|
2
|
+
# "git ls-tree". I have opened https://github.com/schacon/ruby-git/pull/284 to
|
3
|
+
# fix it, but in the meantime, this monkey patch allows analyzing repositories
|
4
|
+
# with submodules.
|
5
|
+
|
6
|
+
module Git
|
7
|
+
|
8
|
+
class Lib
|
9
|
+
|
10
|
+
def ls_tree(sha)
|
11
|
+
# Add 'commit' to the list of valid types.
|
12
|
+
#data = {'blob' => {}, 'tree' => {}}
|
13
|
+
data = {'blob' => {}, 'tree' => {}, 'commit' => {}}
|
14
|
+
|
15
|
+
command_lines('ls-tree', sha).each do |line|
|
16
|
+
(info, filenm) = line.split("\t")
|
17
|
+
(mode, type, sha) = info.split
|
18
|
+
data[type][filenm] = {:mode => mode, :sha => sha}
|
19
|
+
end
|
20
|
+
|
21
|
+
data
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/lib/git-commits-analyzer.rb
CHANGED
@@ -3,6 +3,10 @@ require 'git'
|
|
3
3
|
require 'git_diff_parser'
|
4
4
|
require 'json'
|
5
5
|
|
6
|
+
# Monkey patch for the git gem.
|
7
|
+
# See https://github.com/schacon/ruby-git/pull/284 for more details.
|
8
|
+
require 'git-commits-analyzer/monkey-patch-git'
|
9
|
+
|
6
10
|
# Public: parse git logs for language and commit metadata.
|
7
11
|
#
|
8
12
|
# Examples:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-commits-analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Aubert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Parse git repos and collect commit statistics/data for a given author.
|
14
14
|
email: aubertg@cpan.org
|
@@ -19,6 +19,7 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- bin/analyze_commits
|
21
21
|
- lib/git-commits-analyzer.rb
|
22
|
+
- lib/git-commits-analyzer/monkey-patch-git.rb
|
22
23
|
- lib/git-commits-analyzer/utils.rb
|
23
24
|
homepage: http://rubygems.org/gems/
|
24
25
|
licenses:
|