Codechange: Don't use globals for return values from vehicle command procs.
[openttd-github.git] / .github / changelog.sh
blobb057ad475f05d422d3d0e6153f7c6ea8cc72cf9d
1 #!/bin/sh
3 tag=$(git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\^0$@@')
5 # If we are a tag, show the part of the changelog till (but excluding) the last stable
6 if [ -n "$tag" ]; then
7 grep='^[0-9]\+\.[0-9]\+[^-]'
8 next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
9 cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9]+.[0-9]+/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
10 exit 0
13 # In all other cases, show the git log of the last 7 days
14 revdate=$(git log -1 --pretty=format:"%ci")
15 last_week=$(date -d "$revdate -7days" +"%Y-%m-%d %H:%M")
16 git log --after="${last_week}" --pretty=fuller