]> git.ozlabs.org Git - next-scripts/commitdiff
merge_msg: allow for specifyin the tree on the command line
authorStephen Rothwell <sfr@canb.auug.org.au>
Sun, 27 May 2012 08:48:19 +0000 (18:48 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 27 May 2012 08:48:19 +0000 (18:48 +1000)
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%% *}