diff --git a/phase0.sh b/phase0.sh index 3fb6538..ad496d6 100755 --- a/phase0.sh +++ b/phase0.sh @@ -1,10 +1,24 @@ #!/bin/bash + +TIME="$1 year ago" + + IFS=$'\n' -DATA=(`git log --since="1 week ago" --until="now" --no-merges --format='"%H","%ct","%an","%ae","%s",'`) -LINES=(`git log --since="1 week ago" --until="now" --no-merges --pretty=tformat: --shortstat | gawk '(NF > 0){ printf "%s,%s\n",$1,$4 }' -`) +echo "Load data" +DATA=(`git log --since="$TIME" --until="now" --no-merges --format='%ct,%an,%ae'`) +echo "Load add/remove lines" +LINES=(`git log --since="$TIME" --until="now" --no-merges --pretty=tformat: --shortstat | gawk '(NF > 0){ printf ",%s,%s\n",$1,$4 }' -`) +echo "Load word" +WORD=(`git log --since="$TIME" --until="now" --no-merges --format=',%s'`) + +echo "Create .csv" +touch gitlogy.csv i=0 while [ $i -lt ${#DATA[@]} ]; do - echo "${DATA[$i]}${LINES[$i]}" + echo "${DATA[$i]}${LINES[$i]}${WORD[$i]}" >> gitlogy.csv i=$[i + 1] done + +echo "Parse message" +sed -i -e "s/\ /,/g" gitlogy.csv