From: Beat Bolli Date: Fri, 15 Mar 2024 19:46:18 +0000 (+0100) Subject: contrib/coverage-diff: avoid redundant pipelines X-Git-Tag: v2.45.0-rc0~80^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f70bc702e52796933cafa30dde54fe3c07aa2e81;p=thirdparty%2Fgit.git contrib/coverage-diff: avoid redundant pipelines Merge multiple sed and "grep | awk" invocations, finally use "sort -u" instead of "sort | uniq". Signed-off-by: Beat Bolli Acked-by: Taylor Blau Signed-off-by: Junio C Hamano --- diff --git a/contrib/coverage-diff.sh b/contrib/coverage-diff.sh index 4ec419f900..6ce9603568 100755 --- a/contrib/coverage-diff.sh +++ b/contrib/coverage-diff.sh @@ -74,8 +74,7 @@ do sort >uncovered_lines.txt comm -12 uncovered_lines.txt new_lines.txt | - sed -e 's/$/\)/' | - sed -e 's/^/ /' >uncovered_new_lines.txt + sed -e 's/$/\)/' -e 's/^/ /' >uncovered_new_lines.txt grep -q '[^[:space:]]' >coverage-data.txt && @@ -91,11 +90,7 @@ cat coverage-data.txt echo "Commits introducing uncovered code:" -commit_list=$(cat coverage-data.txt | - grep -E '^[0-9a-f]{7,} ' | - awk '{print $1;}' | - sort | - uniq) +commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u) ( for commit in $commit_list