From: Stephen Rothwell Date: Wed, 7 Dec 2022 04:13:28 +0000 (+1100) Subject: final_msg: use new get_* functions X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=c70e21673f0fec2c3b2ff188464763bd6fc07747;p=next-scripts final_msg: use new get_* functions add another one to get the prending fixes branches --- diff --git a/common.sh b/common.sh index 5ed27b9..31b3922 100644 --- a/common.sh +++ b/common.sh @@ -83,6 +83,11 @@ get_branches() awk -F "$_TAB" '/^[^#]/ && $2=="git"{ print $3; }' "$CTRL_FILE" } +get_pending_branches() +{ + awk -F "$_TAB" '/^[^#]/ && $2=="git"{ print $3; } $1=="pending-fixes" { exit; }' "$CTRL_FILE" +} + get_contacts() { get_control_field "$1" 1 diff --git a/final_msg b/final_msg index 979da9b..0412a2e 100755 --- a/final_msg +++ b/final_msg @@ -9,9 +9,9 @@ subject="linux-next: Tree for $(date --date "5 hours ago" '+%b %-d')" 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 )) +ntrees=$(get_branches | wc -l) +npend=$(get_pending_branches | wc -l) +npend=$(( npend - 1 )) sed -i.bak -e 's/^\(Changes since\) [0-9]*:/\1 '"$prev"':/' \ -e 's/^\(Non-merge commits .*:\) [0-9]*/\1 '"$nmc"'/'\