I wanted a way to see when commits are being made, specifically commits being made during non-business hours when people should be resting and enjoying their lives rather than working... we all work enough, no need to work when you shouldn't be.
Running this on your git command line will tell you how many commits were made between two certain dates outside of "business hours".
This assumes "business hours" to be any time between 8am and 6pm. I realize this is not 9am to 5pm, as the gist would suggest. I did this to make some account for those that come in a little earlier to get started (and hopefully leaving a little earlier), or those that stay a little later (and hopefully comming in a little later). It will also count any commits made on the weekends.
These were the "business hours" that my company operated on. If you would like to adjust the hours this works on, then adjust the hours used in the awk section.
If you would like to adjust the dates that this looks at, simply fill in your dates for the --after and --before variables. These should be in yyyy-mm-dd format.
Run on your Git command line (all on one line as a single command). This will give you a count of how many commits there were.
git log --pretty=format:"%ad %an %s" --date=format:'%H %a' --after="2019-01-03" --before="2019-15-06" | sort -k1,1n -k2,2 | awk '{if ((($1 == "18" || $1 == "19" || $1 == "20" || $1 == "21" || $1 == "22" || $1 == "23" || $1 == "24" || $1 == "00" || $1 == "01" || $1 == "02" || $1 == "03" || $1 == "04" || $1 == "05" || $1 == "06" || $1 == "07") && ($2 != "Sat" && $2 != "Sun")) || ($2 == "Sun" || $2 == "Sat")) print $0;}' | grep -c "00\|01\|02\|03\|04\|05\|06\|07\|18\|19\|20\|21\|22\|23\|24\|Sat\|Sun"
Run on your Git command line (all on one line as a single command). This will print out the commit message for each of the commits.
git log --pretty=format:"%ad %an %s" --date=format:'%H %a' --after="2019-01-03" --before="2019-15-06" | sort -k1,1n -k2,2 | awk '{if ((($1 == "18" || $1 == "19" || $1 == "20" || $1 == "21" || $1 == "22" || $1 == "23" || $1 == "24" || $1 == "00" || $1 == "01" || $1 == "02" || $1 == "03" || $1 == "04" || $1 == "05" || $1 == "06" || $1 == "07") && ($2 != "Sat" && $2 != "Sun")) || ($2 == "Sun" || $2 == "Sat")) print $0;}'
Tumble outta bed and I stumble to the kitchen Pour myself a cup of ambition Yawn and stretch and try to come to life Jump in the shower and the blood starts pumpin' Out on the street the traffic starts jumpin' With folks like me on the job from 9 to 5
Workin' 9 to 5, what a way to make a livin' Barely gettin' by, it's all takin' and no givin' They just use your mind and they never give you credit It's enough to drive you crazy if you let it 9 to 5, for service and devotion You would think that I would deserve a fat promotion Want to move ahead but the boss won't seem to let me I swear sometimes that man is out to get me!
They let you dream just to watch 'em shatter You're just a step on the boss-man's ladder But you got dreams he'll never take away You're in the same boat with a lotta your friends Waitin' for the day your ship'll come in An' the tide's gonna turn and it's all gonna roll your way
Workin' 9 to 5, what a way to make a livin' Barely gettin' by, it's all takin' and no givin' They just use your mind and you never get the credit It's enough to drive you crazy if you let it 9 to 5, yeah they got you where they want you There's a better life, and you dream about it, don't you? It's a rich man's game no matter what they call it And you spend your life puttin' money in his wallet
9 to 5, whoa what a way to make a livin' Barely gettin' by, it's all takin' and no givin' They just use your mind and they never give you credit It's enough to drive you crazy if you let it
9 to 5, yeah they got you where they want you There's a better life, and you dream about it, don't you? It's a rich man's game no matter what they call it And you spend your life puttin' money in his wallet
9 to 5, working 9 to 5
Source: LyricFind