2018-08-06 01:31:40 +00:00
#!/usr/bin/env bash
(
set -e
PS1 = " $"
function changelog( ) {
base = $( git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
2021-12-04 01:20:19 +00:00
cd $1 && git log --oneline ${ base } ...HEAD | sed 's/\(^[0-9a-f]\{8,\}\s\|Revert\s"\)#\([0-9]\+\)/\1PR-\2/'
2018-08-06 01:31:40 +00:00
}
bukkit = $( changelog work/Bukkit)
cb = $( changelog work/CraftBukkit)
spigot = $( changelog work/Spigot)
updated = ""
logsuffix = ""
if [ ! -z " $bukkit " ] ; then
logsuffix = " $logsuffix \n\nBukkit Changes:\n $bukkit "
updated = "Bukkit"
fi
if [ ! -z " $cb " ] ; then
logsuffix = " $logsuffix \n\nCraftBukkit Changes:\n $cb "
if [ -z " $updated " ] ; then updated = "CraftBukkit" ; else updated = " $updated /CraftBukkit " ; fi
fi
if [ ! -z " $spigot " ] ; then
logsuffix = " $logsuffix \n\nSpigot Changes:\n $spigot "
if [ -z " $updated " ] ; then updated = "Spigot" ; else updated = " $updated /Spigot " ; fi
fi
2020-11-23 16:47:27 +00:00
disclaimer = "Upstream has released updates that appear to apply and compile correctly.\nThis update has not been tested by PaperMC and as with ANY update, please do your own testing"
2018-08-06 01:31:40 +00:00
if [ ! -z " $1 " ] ; then
disclaimer = " $@ "
fi
log = " ${ UP_LOG_PREFIX } Updated Upstream ( $updated )\n\n ${ disclaimer } ${ logsuffix } "
echo -e " $log " | git commit -F -
) || exit 1