mirror of
https://github.com/git/git
synced 2024-11-04 16:17:49 +00:00
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>
This commit is contained in:
parent
babf0b89b3
commit
f70bc702e5
1 changed files with 2 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue