From: Stephen Rothwell Date: Mon, 5 Jul 2021 23:19:10 +0000 (+1000) Subject: final_msg: auto generate the number of pending trees X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=6c864e0c6144f7ae6b84c14186350a712512f74f;p=next-scripts final_msg: auto generate the number of pending trees --- diff --git a/final_msg b/final_msg index ebbbc0f..979da9b 100755 --- a/final_msg +++ b/final_msg @@ -10,11 +10,14 @@ prev=$(git tag -l next-* | sort | tail -n 2 | head -n 1 | sed 's/next-//') nmc=$(git rev-list --no-merges --count origin/master..HEAD^) ss=$(git diff --shortstat -M -C origin/master..HEAD^) ntrees=$(grep -v -c '^#' "$CTRL_FILE") +npend=$(sed '/^#/d;/^pending-fixes/q' "$CTRL_FILE" | wc -l) +npend=$(( npend - 2 )) sed -i.bak -e 's/^\(Changes since\) [0-9]*:/\1 '"$prev"':/' \ -e 's/^\(Non-merge commits .*:\) [0-9]*/\1 '"$nmc"'/'\ -e 's/^ *[0-9]* files changed,.*$/'"$ss"'/' \ -e 's/^\(I am currently merging\) [0-9]* /\1 '"$ntrees"' /' \ + -e 's/ [0-9]* \(trees of bug\)/ '"$npend"' \1/' \ ../last_msg "$tools_dir/send_email" "$subject" "$to" "$cc" <../last_msg