about summary refs log tree commit diff
path: root/third_party/git/contrib/coverage-diff.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/contrib/coverage-diff.sh
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/contrib/coverage-diff.sh')
-rwxr-xr-xthird_party/git/contrib/coverage-diff.sh108
1 files changed, 0 insertions, 108 deletions
diff --git a/third_party/git/contrib/coverage-diff.sh b/third_party/git/contrib/coverage-diff.sh
deleted file mode 100755
index 4ec419f90048..000000000000
--- a/third_party/git/contrib/coverage-diff.sh
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/sh
-
-# Usage: Run 'contrib/coverage-diff.sh <version1> <version2>' from source-root
-# after running
-#
-#     make coverage-test
-#     make coverage-report
-#
-# while checked out at <version2>. This script combines the *.gcov files
-# generated by the 'make' commands above with 'git diff <version1> <version2>'
-# to report new lines that are not covered by the test suite.
-
-V1=$1
-V2=$2
-
-diff_lines () {
-	perl -e '
-		my $line_num;
-		while (<>) {
-			# Hunk header?  Grab the beginning in postimage.
-			if (/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/) {
-				$line_num = $1;
-				next;
-			}
-
-			# Have we seen a hunk?  Ignore "diff --git" etc.
-			next unless defined $line_num;
-
-			# Deleted line? Ignore.
-			if (/^-/) {
-				next;
-			}
-
-			# Show only the line number of added lines.
-			if (/^\+/) {
-				print "$line_num\n";
-			}
-			# Either common context or added line appear in
-			# the postimage.  Count it.
-			$line_num++;
-		}
-	'
-}
-
-files=$(git diff --name-only "$V1" "$V2" -- \*.c)
-
-# create empty file
->coverage-data.txt
-
-for file in $files
-do
-	git diff "$V1" "$V2" -- "$file" |
-	diff_lines |
-	sort >new_lines.txt
-
-	if ! test -s new_lines.txt
-	then
-		continue
-	fi
-
-	hash_file=$(echo $file | sed "s/\//\#/")
-
-	if ! test -s "$hash_file.gcov"
-	then
-		continue
-	fi
-
-	sed -ne '/#####:/{
-			s/    #####://
-			s/:.*//
-			s/ //g
-			p
-		}' "$hash_file.gcov" |
-	sort >uncovered_lines.txt
-
-	comm -12 uncovered_lines.txt new_lines.txt |
-	sed -e 's/$/\)/' |
-	sed -e 's/^/ /' >uncovered_new_lines.txt
-
-	grep -q '[^[:space:]]' <uncovered_new_lines.txt &&
-	echo $file >>coverage-data.txt &&
-	git blame -s "$V2" -- "$file" |
-	sed 's/\t//g' |
-	grep -f uncovered_new_lines.txt >>coverage-data.txt &&
-	echo >>coverage-data.txt
-
-	rm -f new_lines.txt uncovered_lines.txt uncovered_new_lines.txt
-done
-
-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)
-
-(
-	for commit in $commit_list
-	do
-		git log --no-decorate --pretty=format:'%an      %h: %s' -1 $commit
-		echo
-	done
-) | sort
-
-rm coverage-data.txt