From: Stephen Rothwell Date: Sun, 27 May 2012 08:48:19 +0000 (+1000) Subject: merge_msg: allow for specifyin the tree on the command line X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=09b273453f2a970980994506bbd1063a52e57aa2;p=next-scripts merge_msg: allow for specifyin the tree on the command line --- diff --git a/merge_msg b/merge_msg index 547fbb9..b314ed2 100755 --- 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%% *}