git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Tiago Botelho <tiagonbotelho@gmail.com>,
	git <git@vger.kernel.org>,
	Harald Nordgren <haraldnordgren@gmail.com>,
	Tiago Botelho <tiagonbotelho@hotmail.com>
Subject: Re: [RFC PATCH v5] Implement --first-parent for git rev-list --bisect
Date: Tue, 26 Jun 2018 15:20:32 -0700	[thread overview]
Message-ID: <xmqqa7rhi40f.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAP8UFD1TeC4czp_8HCRw5CtjGO78A8gRezw_xspnm4MXuhQswg@mail.gmail.com> (Christian Couder's message of "Tue, 26 Jun 2018 17:41:44 +0200")

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.

>> 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.

  parent reply	other threads:[~2018-06-26 22:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 12:39 [RFC PATCH v5] Implement --first-parent for git rev-list --bisect Tiago Botelho
2018-06-25 17:33 ` Junio C Hamano
2018-06-26 11:59   ` Christian Couder
2018-06-26 14:10     ` Johannes Schindelin
2018-06-26 15:41       ` Christian Couder
2018-06-26 21:16         ` Johannes Schindelin
2018-06-26 22:20         ` Junio C Hamano [this message]
2018-06-27 11:48           ` Johannes Schindelin
2018-06-27 16:26             ` Junio C Hamano
2018-06-28 13:08               ` Johannes Schindelin
2018-06-28 16:12                 ` Junio C Hamano
2018-06-29 11:20                   ` Johannes Schindelin
2018-07-03 21:33                     ` Tiago Botelho
2018-07-03 22:36                       ` Junio C Hamano
2018-07-04 10:26                         ` Johannes Schindelin
2018-07-06 18:14                           ` Junio C Hamano
2018-07-06 20:33                             ` Johannes Schindelin
2018-07-06 21:43                               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa7rhi40f.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=haraldnordgren@gmail.com \
    --cc=tiagonbotelho@gmail.com \
    --cc=tiagonbotelho@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).