diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-08-12 18:28:13 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-08-13 20:33:44 +0200 |
commit | ee970f0bde3c90a0dff909c366d4ab1a1bff9b9d (patch) | |
tree | 2da57ae735017d7e7d8805a3a9e1b5e21fd8d150 /commitpkg | |
parent | 35fc83ce7d8dc26cd424321f2e8638d05da0a6d4 (diff) | |
download | devtools32-ee970f0bde3c90a0dff909c366d4ab1a1bff9b9d.tar.xz |
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: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'commitpkg')
-rwxr-xr-x | commitpkg | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -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 - svn commit -q || abort + 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 + vi "$msgfile" + fi + [ -s "$msgfile" ] || abort + svn commit -q -F "$msgfile" || abort + unlink "$msgfile" fi echo 'done' |