git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jun 13, 2019, 15:17 UTC
Message-ID
<20190613151756.GA31952@szeder.dev>
In-Reply-To
<20190610153014.42055-8-brho@google.com>
On Mon, Jun 10, 2019 at 11:30:12AM -0400, Barret Rhoden wrote:
Show 5 quoted lines
> 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
Show 29 quoted lines
> +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.

Previous: Barret RhodenNext: Junio C Hamano
Message 9 of 14 in “blame: add the ability to ignore commits”
  1. 0/9 blame: add the ability to ignore commitsBarret Rhoden, Jun 10, 2019
  2. 1/9 fsck: rename and touch up init_skiplist()Barret Rhoden, Jun 10, 2019
  3. 2/9 Move oidset_parse_file() to oidset.cBarret Rhoden, Jun 10, 2019
  4. 3/9 blame: use a helper function in blame_chunk()Barret Rhoden, Jun 10, 2019
  5. 4/9 blame: add the ability to ignore commits and their changesBarret Rhoden, Jun 10, 2019
  6. 5/9 blame: add config options for the output of ignored or unblamable linesBarret Rhoden, Jun 10, 2019
  7. 6/9 blame: optionally track line fingerprints during fill_blame_origin()Barret Rhoden, Jun 10, 2019
  8. 7/9 blame: add a fingerprint heuristic to match ignored linesBarret Rhoden, Jun 10, 2019
  9. SZEDER GáborJun 13, 2019
  10. Junio C HamanoJun 13, 2019
  11. t8014: avoid git command in upstream pipemichael@platin.gs, Jun 16, 2019
  12. Barret RhodenJun 17, 2019
  13. 8/9 blame: use the fingerprint heuristic to match ignored linesBarret Rhoden, Jun 10, 2019
  14. 9/9 blame: add a test to cover blame_coalesce()Barret Rhoden, Jun 10, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.