Git fork

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 <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Beat Bolli and committed by
Junio C Hamano
f70bc702 babf0b89

+2 -7
+2 -7
contrib/coverage-diff.sh
··· 74 74 sort >uncovered_lines.txt 75 75 76 76 comm -12 uncovered_lines.txt new_lines.txt | 77 - sed -e 's/$/\)/' | 78 - sed -e 's/^/ /' >uncovered_new_lines.txt 77 + sed -e 's/$/\)/' -e 's/^/ /' >uncovered_new_lines.txt 79 78 80 79 grep -q '[^[:space:]]' <uncovered_new_lines.txt && 81 80 echo $file >>coverage-data.txt && ··· 91 90 92 91 echo "Commits introducing uncovered code:" 93 92 94 - commit_list=$(cat coverage-data.txt | 95 - grep -E '^[0-9a-f]{7,} ' | 96 - awk '{print $1;}' | 97 - sort | 98 - uniq) 93 + commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u) 99 94 100 95 ( 101 96 for commit in $commit_list