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

Re: [RFC PATCH v5] Implement --first-parent for git rev-list --bisect

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 26, 2018, 22:20 UTC
Message-ID
<xmqqa7rhi40f.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAP8UFD1TeC4czp_8HCRw5CtjGO78A8gRezw_xspnm4MXuhQswg@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
> Obviousness is often not the same for everybody.

... which you just learned---what you thought obvious turns out to be not so obvious after all, so you adjust to help your readers.

Show 11 quoted lines
>> In this particular case it even feels as if this test is not even testing
>> what it should test at all:
>>
>> - it should verify that all of the commits in the first parent lineage are
>>   part of the list
>
> It does that.
>
>> - it should verify that none of the other commits are in the list
>
> It does that too.

But the point is it does a lot more by insisting exact output. For example, the version I reviewed had a two "expected output", and said that the actual output must match either one of them. I guess it was because there were two entries with the same distance and we cannot rely on which order they appear in the result? If a test history gained another entry with the same distance, then would we need 6 possible expected output because we cannot rely on the order in which these three come out?

That was the only thing I was complaining about. Dscho gave me too much credit and read a lot more good things than what I actually meant to say ;-).

>> And that is really all there is to test.

Another is that "rev-list --bisect-all" promises that the entries are ordered by the distance value. So taking the above three points, perhaps

	cat >expect <<EOF &&
	... as written in one of the expect list in Tiago's patch
	EOF
	# Make sure we have the same entries, nothing more, nothing less
	git rev-list --bisect-all $other_args >actual &&
	sort actual >actual.sorted &&
	sort expect >expect.sorted &&
	test_cmp expect.sorted actual.sorted
	# Make sure the entries are sorted in the dist order
	sed -e 's/.*(dist=\([1-9]*[0-9]\)).*/\1/' actual >actual.dists &&
	sort actual.dists >actual.dists.sorted &&
	test_cmp actual.dists.sorted actual.dists
is what I would have expected.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 18 in “Implement --first-parent for git rev-list --bisect”
  1. Implement --first-parent for git rev-list --bisectTiago Botelho, Jun 22, 2018
  2. Junio C HamanoJun 25, 2018
  3. Christian CouderJun 26, 2018
  4. Johannes SchindelinJun 26, 2018
  5. Christian CouderJun 26, 2018
  6. Johannes SchindelinJun 26, 2018
  7. Junio C HamanoJun 26, 2018
  8. Johannes SchindelinJun 27, 2018
  9. Junio C HamanoJun 27, 2018
  10. Johannes SchindelinJun 28, 2018
  11. Junio C HamanoJun 28, 2018
  12. Johannes SchindelinJun 29, 2018
  13. Tiago BotelhoJul 3, 2018
  14. Junio C HamanoJul 3, 2018
  15. Johannes SchindelinJul 4, 2018
  16. Junio C HamanoJul 6, 2018
  17. Johannes SchindelinJul 6, 2018
  18. Junio C HamanoJul 6, 2018

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.