Commit ee970f0b authored by Lukas Fleischer's avatar Lukas Fleischer Committed by Pierre Schmitz
Browse files

commitpkg: Provide a commit message template



Generate a message template when omitting the commit message (includes
the same subject line that is used if a commit message is specified).

Also, use two newlines to separate the subject line from the message
body as it looks much clearer that way.

Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: default avatarPierre Schmitz <pierre@archlinux.de>
parent 35fc83ce
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -109,11 +109,26 @@ if [ "$1" = "-a" ]; then
fi

echo -n 'committing changes to trunk...'
msgtemplate="upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)

"
if [ -n "$1" ]; then
	svn commit -q -m "upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)
$1" || abort
	svn commit -q -m "${msgtemplate}${1}" || abort
else
	msgfile="$(mktemp)"
	echo "$msgtemplate" > "$msgfile"
	if [ -n "$SVN_EDITOR" ]; then
		$SVN_EDITOR "$msgfile"
	elif [ -n "$VISUAL" ]; then
		$VISUAL "$msgfile"
	elif [ -n "$EDITOR" ]; then
		$EDITOR "$msgfile"
	else
	svn commit -q || abort
		vi "$msgfile"
	fi
	[ -s "$msgfile" ] || abort
	svn commit -q -F "$msgfile" || abort
	unlink "$msgfile"
fi
echo 'done'