git / python> git log analysis (v0.1, v0.2)> Implementation to estimate work time from git log

http://qiita.com/7of9/items/e1e151794f80fb9c24fc I tried to implement the integrated estimate of the work time that I thought about while studying python.

program

v0.1 @ github

How to use

First, create a tmp.log file in the git repository you want to investigate.

$ git log --pretty=format:'%h %ad %s' --date=iso > tmp.log

After that, if you execute the script, tmp.log will be read and the accumulated time will be displayed.

$ ./git_log_analysis.py

The display format is as follows, and 764 in the last line is the accumulated time (minutes).

...
2015-11-13 21:11:06 801 750 # sec, min
2015-11-13 12:53:26 29860 750 # sec, min
2015-11-13 12:44:36 530 758 # sec, min
2015-11-13 12:37:53 403 764 # sec, min
2015-11-13 07:12:08 19545 764 # sec, min

The linemonitor python implementation (core part) seems to have taken a total (at least) 12 hours.

Unestimated time

In the total time calculation, it is considered that there was no work for 4 hours or more. In my case, I don't commit for more than 4 hours. The user should change this area as appropriate.

def calcElapsedTimeInMinutes(diff_sec):
	diff_min = diff_sec / 60
	diff_hr = diff_min / 60
	if diff_hr >= 4:
		return 0
	else:
		return diff_min

Since it is basically just the difference between the two dates and times, at least the following uncertainties are included

--I haven't taken all the time difference into the implementation --Estimates deviate when working while switching between multiple repositories

v0.2

Hitting the git log command one by one seemed tedious.

I remembered that I was executing a command when I implemented shutdownButton, so in v0.2 I made tmp.log automatically. Note that if tmp.log already exists, it will be overwritten.

v0.2 @ github

Recommended Posts

git / python> git log analysis (v0.1, v0.2)> Implementation to estimate work time from git log
Python (from first time to execution)
[Python] Flow from web scraping to data analysis
progate Python learning memo (updated from time to time)
From easy git installation to docker startup python
Python: Time Series Analysis
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Machine learning python code summary (updated from time to time)
Apache settings, log confirmation, etc. (* Updated from time to time)
[Updated from time to time] Python memos often used for data analysis [N division, etc.]
Meteorology x Python ~ From weather data acquisition to spectrum analysis ~
How to call Python or Julia from Ruby (experimental implementation)
Post from Python to Slack
Cheating from PHP to Python
Migrating from Chainer v1 to Chainer v2
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
Python OCR System Raise characters from images to improve work efficiency
What to do if Python doesn't work on Git for Windows
Introduction to Data Analysis with Python P17-P26 [ch02 1.usa.gov data from bit.ly]
From the introduction of JUMAN ++ to morphological analysis of Japanese with Python
[Note] AI / machine learning / python related websites [updated from time to time]
vtkXMLUnstructuredGridReader Summary (updated from time to time)
vtkOpenFOAMReader Summary (Updated from time to time)
Python: Time Series Analysis: Preprocessing Time Series Data
Engineer vocabulary (updated from time to time)
Create folders from '01' to '12' with python
[Lambda] [Python] Post to Twitter from Lambda!
[python] Copy script to generate copy log
Connect to utf8mb4 database from python
Tensorflow memo [updated from time to time]
Post images from Python to Tumblr
How to access wikipedia from python
Python to switch from another language
Add TRACE log level to Python ...?
Introduction to image analysis opencv python
Review from git init to git push
Did not change from Python 2 to 3
Update Python on Mac from 2 to 3
From preparation for morphological analysis with python using polyglot to part-of-speech tagging