From 118f1110067a4ab5cc3583ee0ab030f27f684300 Mon Sep 17 00:00:00 2001 From: Meghan Date: Mon, 9 Nov 2020 14:52:56 -0800 Subject: [PATCH] Create changelog.sh --- changelog.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 changelog.sh diff --git a/changelog.sh b/changelog.sh new file mode 100755 index 0000000000000000000000000000000000000000..c8229766a1b439c28dbb042fdfec50de9e5e805b --- /dev/null +++ b/changelog.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -e + +read-log() { + git log --format=format:"%h%n%H%n%an%n%s%n%d%n" +} + +hash_abrev='' +hash='' +author='' +title='' + +c=0 +t=0 +read-log | +while IFS= read -r lineVAR; do + if [[ "$c" == '0' ]]; then + hash_abrev="$lineVAR" + fi + if [[ "$c" == '1' ]]; then + hash="$lineVAR" + fi + if [[ "$c" == '2' ]]; then + author="$lineVAR" + fi + if [[ "$c" == '3' ]]; then + title="$lineVAR" + fi + if [[ "$c" == '4' ]]; then + if [ ! -z "$lineVAR" ]; then + t=$(($t+1)) + fi + if [[ "$t" == '2' ]]; then + break + fi + echo "
  • $hash_abrev $title ($author)
  • " + fi + c=$(($c+1)) + # + if [[ "$c" == '6' ]]; then + c=0 + fi +done -- 2.54.0