git-hacks

git-hacks Git Source Tree

Root/git-cost

1#! /bin/sh
2#
3# Give an idea on what is the development cost (in
4# term of money) of a given span of activity.
5#
6#
7# Installation
8# ============
9#
10# Adjust the value of `rate' to fit your needs and
11# put the script somewhere in your path.
12#
13#
14# Usage
15# =====
16#
17# git cost [RANGE]
18#
19# If RANGE is not specificed, the script will consider
20# the whole repository history.
21#
22# If you want to specify a range, everything `git log'
23# can accept is valid:
24#
25# git cost 0.5.0..0.6.0
26# git cost @{yesterday}..
27# git cost mybranch
28
29
30# The cost of a single LOC (line of code).
31# XXX: 1 is an arbitrary rate!
32rate='1'
33
34git log --stat $@ | awk "/ ([0-9]+) insertions/ { s+=\$4 } END { print s*$rate }"

Archive Download this file

Branches