Skip to content

Instantly share code, notes, and snippets.

@stephenmcd
Created October 27, 2011 04:29
Show Gist options
  • Save stephenmcd/1318777 to your computer and use it in GitHub Desktop.
Save stephenmcd/1318777 to your computer and use it in GitHub Desktop.
Estimated project cost of a Mercurial repository
# A one-liner for calculating the cost of a project using a Mercurial repo.
# Replace:
# ignore|paths - pipe separated strings in paths to ignore
# eg: embedded libraries and generated code.
# mins_per_loc - estimated minutes per line of code.
# hourly_rate - hourly dollar rate being charged.
$ hg log --stat | egrep -v 'ignore|paths' | grep '|' | awk '{s+=$3} END {print "$" s / 60 * mins_per_loc * hourly_rate}'
@ajfisher
Copy link

Minutes per line of code (which seems the right metric to me) or lines of code per minute?

@stephenmcd
Copy link
Author

Yeah the comment is wrong. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment