Skip to content

Commit b219a05

Browse files
committed
Add script to print the number of commits per month
1 parent 0c743ab commit b219a05

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Prints the number of commits per month.
4+
5+
# * `git log`
6+
# - Show commit logs.
7+
# * `grep Date`
8+
# - Extract the line which begins with `Date` from each log.
9+
# * `awk '{}'`
10+
# - From each date line, extract the month (`$3`).
11+
# * `sort -M`
12+
# - Sort by month name.
13+
# * `uniq -c`
14+
# - Remove repeated lines and count the repeats to show monthly totals.
15+
git log | grep Date | awk '{print $3}' | sort -M | uniq -c

0 commit comments

Comments
 (0)