]> git.ozlabs.org Git - next-scripts/blobdiff - merge_msg
merge_msg: allow for specifyin the tree on the command line
[next-scripts] / merge_msg
index 547fbb92821393cf46fa9a7b7e61d13212091da9..b314ed2d209935805a5cbe32f1c7b78d47521a7c 100755 (executable)
--- a/merge_msg
+++ b/merge_msg
@@ -5,9 +5,17 @@ log=../merge.log
 control=../real_control
 [ -f real_control ] && control=real_control
 
-branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
-branch=${branch#quilt/}
-branch=${branch%%/*}
+branch=""
+[ "$1" = "-t" ] && {
+        branch=$2
+        shift 2
+}
+
+[ "$branch" ] || {
+       branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
+       branch=${branch#quilt/}
+       branch=${branch%%/*}
+}
 
 contact=$(awk -F '     ' '$3=="'"$branch"'" { print $1; }' $control)
 greeting=${contact%% *}