| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -eu |
| 4 |
|
| 5 |
usage () { |
| 6 |
cat >&2 <<EOF |
| 7 |
usage: $0 |
| 8 |
|
| 9 |
Create a CHANGELOG to-do list for items between the last commit that touched |
| 10 |
the CHANGELOG and the current commit. |
| 11 |
EOF |
| 12 |
} |
| 13 |
|
| 14 |
test $# -eq 0 || { usage; exit 1; } |
| 15 |
|
| 16 |
clog=CHANGELOG.md |
| 17 |
headrev=$(git rev-parse HEAD) |
| 18 |
|
| 19 |
lastrev=$(git rev-list --no-merges --first-parent -n1 HEAD -- ":(top)$clog") |
| 20 |
if test -z "$lastrev" |
| 21 |
then |
| 22 |
echo >&2 "Could not determine last commit to touch $clog" |
| 23 |
exit 1 |
| 24 |
fi |
| 25 |
|
| 26 |
fmt="? %s%n %h^-1" |
| 27 |
range="$lastrev..$headrev" |
| 28 |
|
| 29 |
cat <<EOF |
| 30 |
Update $(git describe "HEAD:$clog") |
| 31 |
|
| 32 |
Generated with |
| 33 |
git log --format="$fmt" --reverse --first-parent \\ |
| 34 |
$range |
| 35 |
|
| 36 |
? = unprocessed and undecided |
| 37 |
- = decided not to include |
| 38 |
+ = included |
| 39 |
+* = included, but might still be bits that should be added |
| 40 |
----------------------------------------------------------- |
| 41 |
|
| 42 |
EOF |
| 43 |
|
| 44 |
git log --format="$fmt" --reverse --first-parent "$range" |