git_time_extractor 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +4 -3
- data/lib/git_time_extractor.rb +4 -2
- metadata +2 -1
data/README.txt
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
= git_time_extractor
|
2
2
|
|
3
|
+
RubyGem Page: https://rubygems.org/gems/git_time_extractor
|
3
4
|
Project Wiki: https://github.com/rietta/git_time_extractor/wiki
|
4
5
|
|
5
6
|
== DESCRIPTION:
|
6
7
|
|
7
8
|
EXTRACT REASONABLE TIME RECORDS FROM A GIT REPOSITORY
|
8
9
|
|
9
|
-
git_time_extractor is a free tool that goes through a GIT, the popular revision control system, repository's commit log and produces a Comma
|
10
|
+
git_time_extractor is a free tool that goes through a GIT, the popular revision control system, repository's commit log and produces a Comma Separated Values (CSV) file that indicates the time spent by each developer, per day.
|
10
11
|
|
11
12
|
The working time estimates are based on three assumptions:
|
12
13
|
|
13
|
-
1. A series of commits within a 3 hour window are part of the same development session
|
14
|
+
1. A series of commits within a three (3) hour window are part of the same development session
|
14
15
|
2. A single commit (or the first commit of the session) is considered to represent 30 minutes of work time
|
15
|
-
3. The more
|
16
|
+
3. The more frequently a developer commits to the repository while working, the more accurate the time report will be
|
16
17
|
|
17
18
|
This script is based on previous code published publicly by Sharad at http://www.tatvartha.com/2010/01/generating-time-entry-from-git-log/. However, it has been adapted to run without Rails from the command line. The portions of the code written by Rietta are licensed under the terms of the BSD license (see section 3 below).
|
18
19
|
|
data/lib/git_time_extractor.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Portions (C) 2012 Rietta Inc. and licensed under the terms of the BSD license.
|
9
9
|
#
|
10
10
|
class GitTimeExtractor
|
11
|
-
VERSION = '0.2.
|
11
|
+
VERSION = '0.2.1'
|
12
12
|
|
13
13
|
require 'rubygems'
|
14
14
|
require 'ostruct'
|
@@ -95,7 +95,9 @@ class GitTimeExtractor
|
|
95
95
|
duration = commit.author_date - previous_commit.author_date
|
96
96
|
|
97
97
|
# ASSUMPTION: if the gap between 2 commits is more than 3 hours, reduce it to 1/2 hour
|
98
|
-
|
98
|
+
# Also, if the time is negative then this is usually a merge operation. Assume the developer spent
|
99
|
+
# 30 minutes reviewing it
|
100
|
+
duration = 30 * 60 if duration < 0 || duration > 3 * 3600
|
99
101
|
else
|
100
102
|
# ASSUMPTION: first commit took 1/2 hour
|
101
103
|
duration = 30 * 60
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_time_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -45,6 +45,7 @@ dependencies:
|
|
45
45
|
version: '0'
|
46
46
|
description: Compute the estimated time spent by developers working on code within
|
47
47
|
a GIT respository. Useful for verifying developer timesheets and for tax purposes.
|
48
|
+
See https://github.com/rietta/git_time_extractor/wiki.
|
48
49
|
email: products@rietta.com
|
49
50
|
executables:
|
50
51
|
- git_time_extractor
|