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

Re: [PATCH 2/3] Add a test for git-rerere

From
Junio C Hamano <junkio@cox.net>
Date
Dec 20, 2006, 18:37 UTC
Message-ID
<7v4prqfm6c.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0612201737190.19693@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> +cat > a1 << EOF
> +Whether 'tis nobler in the mind to suffer
> +The slings and arrows of outrageous fortune,
> +Or to take arms against a sea of troubles,
> +And by opposing end them? To die: to sleep;
> +No more; and by a sleep to say we end
> +The heart-ache and the thousand natural shocks
> +That flesh is heir to, 'tis a consummation
> +Devoutly to be wish'd.
> +EOF

This is out of copyright protection long time ago, so it would be fine to use in example ;-).

Show 6 quoted lines
> +sha1=4f58849a60b4f969a2848966b6d02893b783e8fb
> +rr=.git/rr-cache/$sha1
> +test_expect_success 'recorded preimage' "grep ======= $rr/preimage"
> +
> +test_expect_success 'no postimage or thisimage yet' \
> +	"test ! -f $rr/postimage -a ! -f $rr/thisimage"

I am worried that this test specifies the behaviour a bit too precisely. It is not t0000 basic where we want bit-for-bit match with the expected result. Wouldn't this test break when you further improve xdl_merge, for example?

> +rm $rr/postimage
> +echo -ne "$sha1\ta1\0" > .git/rr-cache/MERGE_RR
Hmmmmmm.  I've stayed away from "echo -e" so far...
> +sha2=4000000000000000000000000000000000000000
> +rr2=.git/rr-cache/$sha2
> +mkdir $rr2
> +echo Hello > $rr2/preimage
Collisions are not so likely and perhaps we do not care.
Show 8 quoted lines
> +case "$(date -d @11111111 +%s 2>/dev/null)" in
> +[1-9]*)
> +	# it is a recent GNU date. good.
> +	now=$(date +%s)
> +	let almost_15_days_ago=$now+60-15*86400
> +	let just_over_15_days_ago=$now-1-15*86400
> +	let almost_60_days_ago=$now+60-60*86400
> +	let just_over_60_days_ago=$now-1-60*86400
Hmmmmm.  I've stayed away from "let" so far as well...
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 5 in “Add a test for git-rerere”
  1. 2/3 Add a test for git-rerereJohannes Schindelin, Dec 20, 2006
  2. Junio C HamanoDec 20, 2006
  3. Johannes SchindelinDec 21, 2006
  4. Junio C HamanoDec 21, 2006
  5. Add a test for git-rerereJohannes Schindelin, Dec 21, 2006

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.