aboutsummaryrefslogtreecommitdiff
path: root/contrib/coverage-diff.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-25 16:16:34 -0700
committerJunio C Hamano <gitster@pobox.com>2024-03-25 16:16:34 -0700
commita7f0fcb335cdd01a01e22fe80bc66c3eee2d9f38 (patch)
tree83a700dcda66f4985ef7603ff2448f2520c0fd0d /contrib/coverage-diff.sh
parent46d8bf30e47c0426e83c9899f55703807eb3129b (diff)
parentc2a7536354561279eec277021690bf0fe9200b7b (diff)
downloadgit-a7f0fcb335cdd01a01e22fe80bc66c3eee2d9f38.tar.xz
Merge branch 'bb/sh-scripts-cleanup'
Shell scripts clean-up. * bb/sh-scripts-cleanup: (22 commits) git-quiltimport: avoid an unnecessary subshell contrib/coverage-diff: avoid redundant pipelines t/t9*: merge "grep | sed" pipelines t/t8*: merge "grep | sed" pipelines t/t5*: merge a "grep | sed" pipeline t/t4*: merge a "grep | sed" pipeline t/t3*: merge a "grep | awk" pipeline t/t1*: merge a "grep | sed" pipeline t/t9*: avoid redundant uses of cat t/t8*: avoid redundant use of cat t/t7*: avoid redundant use of cat t/t6*: avoid redundant uses of cat t/t5*: avoid redundant uses of cat t/t4*: avoid redundant uses of cat t/t3*: avoid redundant uses of cat t/t1*: avoid redundant uses of cat t/t0*: avoid redundant uses of cat t/perf: avoid redundant use of cat t/annotate-tests.sh: avoid redundant use of cat t/lib-cvs.sh: avoid redundant use of cat ...
Diffstat (limited to 'contrib/coverage-diff.sh')
-rwxr-xr-xcontrib/coverage-diff.sh9
1 files changed, 2 insertions, 7 deletions
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:]]' <uncovered_new_lines.txt &&
echo $file >>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