Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking work hours through git [closed]

Tags:

git

bash

tracking

I recently finished a project that involved me working variable hours in one sitting.

For example, I might start at 8AM and go till 2:30 PM. I would make a commit as soon as I started, and commit right before I left.

I want to approximate how many hours I have worked on this project.

I had planned on looking through my commits and figuring this out manually, but the git web interface just gives a vague timestamp such as "authored 2 months ago".

Does anybody know of any third party app that counts hours through git?

Or hopefully provide any pointers on what to try next?

Thanks!

like image 922
Luis Naranjo Avatar asked Aug 15 '13 22:08

Luis Naranjo


2 Answers

Since I couldn't manage to build git-hours I made a tool to estimate the work done by each developer on the repository, following a similar simple algorithm: it still assumes a flat duration for the first commit of the session.

You can get it here: git-estimate

The code is written in plain go and uses go-git to read the repo's commits.

Usage

At a minimum run:

git-estimate -repo=/path/to/repo

this will use default settings to compute the time spent on the repo at the specified path.

git-estimate -h
  -baseline float
        baseline value for session estimate (default 2)
  -estimate string
        estimation method. Accepted values are "session" and "day". (default "session")
  -json
        if true will output estimates in JSON format
  -repo string
        git repository path. If no flag is specified the current folder is assumed (default ".")
like image 119
Luigitni Avatar answered Sep 28 '22 00:09

Luigitni


git-hours didn't work for me. So I have built a simple npm script called git-time.

Install

npm install -g git-time

Usage

git-time <path>

Where <path> should be a valid Git repo root path.

like image 36
vmf91 Avatar answered Sep 28 '22 00:09

vmf91