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

Re: [PATCH 1/3] t3404: preserve test_tick state across short SHA-1 collision test

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 25, 2013, 05:55 UTC
Message-ID
<20130825055550.GN2882@elie.Belkin>
In-Reply-To
<1377112378-45511-2-git-send-email-sunshine@sunshineco.com>
Hi,
Eric Sunshine wrote:
> The short SHA-1 collision test requires carefully crafted commits in
> order to ensure a collision at rebase time.

Yeah, this breaks the usual rule that tests should be independent of hashing function. But it's the best we can do, I think.

[...]
Show 12 quoted lines
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -994,17 +994,23 @@ test_expect_success 'short SHA-1 setup' '
>  	test_when_finished "git checkout master" &&
>  	git checkout --orphan collide &&
>  	git rm -rf . &&
> +	(
>  	unset test_tick &&
>  	test_commit collide1 collide &&
>  	test_commit --notick collide2 collide &&
>  	test_commit --notick "collide3 115158b5" collide collide3 collide3
> +	)
Would be clearer if the code in a subshell were indented:
	(
		unset test_tick &&
		test_commit ...
	)
[...]
Show 9 quoted lines
>  test_expect_success 'short SHA-1 collide' '
>  	test_when_finished "reset_rebase && git checkout master" &&
>  	git checkout collide &&
> +	(
> +	unset test_tick &&
> +	test_tick &&
>  	FAKE_COMMIT_MESSAGE="collide2 815200e" \
>  	FAKE_LINES="reword 1 2" git rebase -i HEAD~2
> +	)
Likewise.

Hope that helps, Jonathan

Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 12 in “t3404 incremental improvements”
  1. 0/3 t3404 incremental improvementsEric Sunshine, Aug 21, 2013
  2. 1/3 t3404: preserve test_tick state across short SHA-1 collision testEric Sunshine, Aug 21, 2013
  3. Jonathan NiederAug 25, 2013
  4. Eric SunshineAug 25, 2013
  5. Jonathan NiederAug 25, 2013
  6. Junio C HamanoAug 26, 2013
  7. 2/3 t3404: make tests more self-containedEric Sunshine, Aug 21, 2013
  8. Junio C HamanoAug 21, 2013
  9. 3/3 t3404: simplify short SHA-1 collision testEric Sunshine, Aug 21, 2013
  10. Junio C HamanoAug 21, 2013
  11. Eric SunshineAug 22, 2013
  12. Junio C HamanoAug 22, 2013

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.