Adding this script because .... well... we love open source and stuff.
authorFabian Groffen <grobian@gentoo.org>
Wed, 28 Mar 2007 19:35:07 +0000 (19:35 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 28 Mar 2007 19:35:07 +0000 (19:35 -0000)
A little script to turn an SVN range (revision1:revision2) into a
"Merged from trunk" message, used when merging changes from the trunk
into the prefix branch.

svn path=/main/branches/prefix/; revision=6315

svnlogmsg.awk [new file with mode: 0755]

diff --git a/svnlogmsg.awk b/svnlogmsg.awk
new file mode 100755 (executable)
index 0000000..0fdd721
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+# bla bla
+# probably can be done much better, but I got tired of copy 'n' paste
+# from mutt into a commit message ...
+
+[[ -z $1 ]] && exit -1
+
+svn log ../../trunk -r$1 | awk -v revs=$1 '
+BEGIN {
+       term = 0
+       print "<html>"
+       print "Merged from trunk " revs
+       print "<table border=\"1\">"
+}
+{
+       if ($0 ~ /^--*$/) {
+               if (term == 1) {
+                       print "</td></tr>"
+               }
+               print "<tr>"
+       } else if ($0 ~ /^r[0-9][0-9]* \| .*$/) {
+               print "<td valign=\"top\">" substr($1, 2) "<br />"
+               if ($3 == "vapier") {
+                       $3 = "SpankMan"
+               } else if ($3 == "antarus") {
+                       $3 = "WarnerBro"
+               }
+               print $3 "</td><td>"
+       } else if ($0 ~ /^..*$/) {
+               if (noprint == 0) {
+                       print $0
+                       term = 1
+               }
+       }
+}
+END {
+       if (term == 1) {
+               print "</td></tr>"
+       }
+       print "</table></html>"
+}
+' | elinks -dump