On Friday, August 12, 2011, Lukas Fleischer <<a href="mailto:archlinux@cryptocrack.de">archlinux@cryptocrack.de</a>> wrote:<br>> Generate a message template when omitting the commit message (includes<br>> the same subject line that is used if a commit message is specified).<br>
><br>> Also, use two newlines to separate the subject line from the message<br>> body as it looks much clearer that way.<br>><br>> Signed-off-by: Lukas Fleischer <<a href="mailto:archlinux@cryptocrack.de">archlinux@cryptocrack.de</a>><br>
> ---<br>> I fully agree that this is a bit hacky. I really dislike the current<br>> behaviour of adding a header if a message is specified on the command<br>> line and not adding anything if you use an editor.<br>
<br>This gets a +1 from me (untested), it is crazy SVN makes this so hard to do.<br>><br>> If anyone can come up with a better idea - suggestions welcome!<br>><br>>  commitpkg |   21 ++++++++++++++++++---<br>>  1 files changed, 18 insertions(+), 3 deletions(-)<br>
><br>> diff --git a/commitpkg b/commitpkg<br>> index 07b0994..be40344 100755<br>> --- a/commitpkg<br>> +++ b/commitpkg<br>> @@ -109,11 +109,26 @@ if [ "$1" = "-a" ]; then<br>>  fi<br>
><br>>  echo -n 'committing changes to trunk...'<br>> +msgtemplate="upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)<br>> +<br>> +"<br>>  if [ -n "$1" ]; then<br>
> -       svn commit -q -m "upgpkg: $pkgbase $(get_full_version ${epoch:-0} $pkgver $pkgrel)<br>> -$1" || abort<br>> +       svn commit -q -m "${msgtemplate}${1}" || abort<br>>  else<br>> -       svn commit -q || abort<br>
> +       msgfile="$(mktemp)"<br>> +       echo "$msgtemplate" > "$msgfile"<br>> +       if [ -n "$SVN_EDITOR" ]; then<br>> +               $SVN_EDITOR "$msgfile"<br>
> +       elif [ -n "$VISUAL" ]; then<br>> +               $VISUAL "$msgfile"<br>> +       elif [ -n "$EDITOR" ]; then<br>> +               $EDITOR "$msgfile"<br>> +       else<br>
> +               vi "$msgfile"<br>> +       fi<br>> +       [ -s "$msgfile" ] || abort<br>> +       svn commit -q -F "$msgfile" || abort<br>> +       unlink "$msgfile"<br>
>  fi<br>>  echo 'done'<br>><br>> --<br>> 1.7.6<br>><br>>