Skip to content

Commit

Permalink
Sketch of a release notes utility.
Browse files Browse the repository at this point in the history
Dump all the commit messages since the last one whose title begins with
`Release`.

See #65.
  • Loading branch information
flatheadmill committed Sep 11, 2019
1 parent fef3197 commit f36d8a7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions libexec/dots/node/notes.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env zsh

set -e

#zmodload zsh/pcre
#setopt REMATCH_PCRE

tmp=$(mktemp -d)
trap "rm -rf $tmp" EXIT

# https://gist.github.com/earthgecko/3089509
separator=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | fold -w ${1:-32} | head -n 1)

dir=$(pwd)
( \
{ cd "$tmp" && git -C "$dir" log --format=%B$separator | \
csplit -s -k -n 5 - "/$separator/" '{99999}'; } 2> /dev/null || true; \
)

echo "----------"
for file in $( cd "$tmp" && echo xx*(on) ); do
if head -n 2 "$tmp/$file" | grep 'Release' > /dev/null; then
#if head -n 1 "$tmp/$file" | grep 'Release'; then
break
else
cat "$tmp/$file"
fi
done

0 comments on commit f36d8a7

Please sign in to comment.