OpenVPN2013: git-per-day-summaries.sh

File git-per-day-summaries.sh, 907 bytes (added by Samuli Seppänen, 6 years ago)

Script to generate per-day Git summaries suitable for Trac

Line 
1#!/bin/sh
2#
3# This nasty script generates git log output suitable for per-day commit
4# summaries. It ex
5
6if [ "$1" = "" ]; then
7    echo "Usage: git-per-day-summaries.sh <git-revision-range>"
8    echo
9    echo "Example:"
10    echo "    git-per-day-summaries.sh 462b6d5...0eb3985"
11    exit 1
12fi
13
14
15SHORTLASTDATE=""
16
17git log --oneline --format="%h|%cD|%an|%s" $1|while read COMMIT; do
18
19    COMMITID=`echo $COMMIT|cut -d "|" -f 1`
20    DATE=`echo $COMMIT|cut -d "|" -f 2`
21    SHORTDATE=`echo $DATE|cut -d " " -f 2-4`
22    WEEKDAY=`echo $DATE|cut -d " " -f 1|cut -d "," -f 1`
23    AUTHORNAME=`echo $COMMIT|cut -d "|" -f 3`
24    SUBJECT=`echo $COMMIT|cut -d "|" -f 4`
25
26    if [ "$SHORTDATE" = "$SHORTLASTDATE" ]; then
27        echo "  * $AUTHORNAME: $SUBJECT ($COMMITID)"
28    else
29        echo " * $SHORTDATE ($WEEKDAY):"
30        echo "  * $AUTHORNAME: $SUBJECT ($COMMITID)"
31    fi
32
33    SHORTLASTDATE=$SHORTDATE
34
35done