Subject: Re: [PATCH v8 7/9] blame: add a fingerprint heuristic to match ignored lines

From: SZEDER Gábor <[email-masked]>
Date: Thu, 13 Jun 2019 17:17:56 +0200

On Mon, Jun 10, 2019 at 11:30:12AM -0400, Barret Rhoden wrote:
> diff --git a/t/t8014-blame-ignore-fuzzy.sh b/t/t8014-blame-ignore-fuzzy.sh
> new file mode 100755
> index 000000000000..1d8fa1da74c9
> --- /dev/null
> +++ b/t/t8014-blame-ignore-fuzzy.sh

> +for i in $(test_seq 2 $last_test); do
> +	eval title="\$title$i"
> +	test_expect_success "$title" \
> +	"git blame -M9 --ignore-rev $IGNOREME $i | sed -e \"$pick_author\" >actual && test_cmp expected$i actual"
> +done
> +
> +# This invoked a null pointer dereference when the chunk callback was called
> +# with a zero length parent chunk and there were no more suspects.
> +test_expect_success 'Diff chunks with no suspects' '
> +	test_write_lines xy1 A B C xy1 >file &&
> +	git add file &&
> +	test_tick &&
> +	GIT_AUTHOR_NAME=1 git commit -m 1 &&
> +
> +	test_write_lines xy2 A B xy2 C xy2 >file &&
> +	git add file &&
> +	test_tick &&
> +	GIT_AUTHOR_NAME=2 git commit -m 2 &&
> +	REV_2=$(git rev-parse HEAD) &&
> +
> +	test_write_lines xy3 A >file &&
> +	git add file &&
> +	test_tick &&
> +	GIT_AUTHOR_NAME=3 git commit -m 3 &&
> +	REV_3=$(git rev-parse HEAD) &&
> +
> +	test_write_lines 1 1 >expected &&
> +
> +	git blame --ignore-rev $REV_2 --ignore-rev $REV_3 file | sed -e "$pick_author" >actual &&

Please use an intermediate file between 'git blame' and the downstream
'sed' command, here and in other tests as well.

This test script focuses specifically on 'git blame', but that pipe
hides its exit code.