File: changelog.sh

package info (click to toggle)
golang-github-evilsocket-ftrace 1.2.0-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 128 kB
  • sloc: sh: 71; makefile: 5
file content (64 lines) | stat: -rwxr-xr-x 1,175 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash

NEW=()
FIXES=()
MISC=()

echo "@ Fetching remote tags ..."

# git fetch --tags > /dev/null

CURTAG=$(git describe --tags --abbrev=0)
OUTPUT=$(git log $CURTAG..HEAD --oneline)
IFS=$'\n' LINES=($OUTPUT)

for LINE in "${LINES[@]}"; do
    LINE=$(echo "$LINE" | sed -E "s/^[[:xdigit:]]+\s+//")
    if [[ $LINE = *"new:"* ]]; then
        LINE=$(echo "$LINE" | sed -E "s/^new: //")
        NEW+=("$LINE")
    elif [[ $LINE = *"fix:"* ]]; then
        LINE=$(echo "$LINE" | sed -E "s/^fix: //")
        FIXES+=("$LINE") 
    elif [[ $LINE != *"i did not bother commenting"* ]] && [[ $LINE != *"Merge "* ]]; then 
        echo "MISC LINE =$LINE"
        LINE=$(echo "$LINE" | sed -E "s/^[a-z]+: //")
        MISC+=("$LINE")
    fi
done

echo
echo "Changelog"
echo "==="

if [ -n "$NEW" ]; then
    echo
    echo "**New Features**"
    echo
    for l in "${NEW[@]}"
    do
        echo "* $l"
    done
fi

if [ -n "$FIXES" ]; then
    echo
    echo "**Fixes**"
    echo
    for l in "${FIXES[@]}"
    do
        echo "* $l"
    done
fi

if [ -n "$MISC" ]; then
    echo
    echo "**Misc**"
    echo
    for l in "${MISC[@]}"
    do
        echo "* $l"
    done
fi

echo