git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tiago Botelho <tiagonbotelho@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
	johannes.schindelin@gmx.de, haraldnordgren@gmail.com,
	Tiago Botelho <tiagonbotelho@hotmail.com>
Subject: Re: [RFC PATCH v3 2/2] Add tests for rev-list --bisect* --first-parent
Date: Thu, 24 May 2018 11:42:17 +0900	[thread overview]
Message-ID: <xmqq7entu646.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180523120110.36532-1-tiagonbotelho@hotmail.com> (Tiago Botelho's message of "Wed, 23 May 2018 13:01:10 +0100")

Tiago Botelho <tiagonbotelho@gmail.com> writes:

> Subject: [RFC PATCH v3 1/2] Implement --first-parent for git rev-list --bisect
> Subject: [RFC PATCH v3 2/2] Add tests for rev-list --bisect* --first-parent

perhaps

	bisect: teach "git rev-list --bisect" to work with "--first-parent"
	bisect: test "git rev-list --first-parent --bisect"

or soemthing?  I _think_ it is probably preferrable to have the test
in the primary patch, making these two patches into one.

> ---
>  t/t6002-rev-list-bisect.sh | 39 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>
> diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
> index a66140803..977c82157 100755
> --- a/t/t6002-rev-list-bisect.sh
> +++ b/t/t6002-rev-list-bisect.sh
> @@ -263,4 +263,43 @@ test_expect_success 'rev-parse --bisect can default to good/bad refs' '
>  	test_cmp expect.sorted actual.sorted
>  '
>  
> +# We generate the following commit graph:
> +#
> +#     A
> +#    / \
> +#   D   B
> +#   |   |
> +#   EX  C
> +#    \  /
> +#     FX

Existing ascii art in the same script seems to draw the history
growing from bottom to top, the other way around.  Please be
consistent.  I think that we tend to draw simple histories growing
from left to right, and a more complex ones from bottom to top.

> +test_expect_success 'setup' '
> +  test_commit A &&
> +  test_commit B &&
> +  test_commit C &&
> +  git reset --hard A &&
> +  test_commit D &&
> +  test_commit EX &&
> +  test_merge FX C
> +'
> +
> +test_output_expect_success "--bisect --first-parent" 'git rev-list --bisect --first-parent FX ^A' <<EOF
> +$(git rev-parse EX)
> +EOF

OK, because our range has odd number of commits on the first-parent
chain, the middle one is unambiguously the one to pick.

> +test_output_expect_success "--bisect-vars --first-parent" 'git rev-list --bisect-vars --first-parent FX ^A' <<EOF
> +bisect_rev='$(git rev-parse EX)'
> +bisect_nr=1
> +bisect_good=0
> +bisect_bad=1
> +bisect_all=3
> +bisect_steps=1
> +EOF
> +
> +test_output_expect_success "--bisect-all --first-parent" 'git rev-list --bisect-all --first-parent FX ^A' <<EOF
> +$(git rev-parse D) (dist=1)
> +$(git rev-parse EX) (dist=1)
> +$(git rev-parse FX) (dist=0)
> +EOF
> +
>  test_done

      reply	other threads:[~2018-05-24  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 12:01 [RFC PATCH v3 2/2] Add tests for rev-list --bisect* --first-parent Tiago Botelho
2018-05-24  2:42 ` Junio C Hamano [this message]

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

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

  git send-email \
    --in-reply-to=xmqq7entu646.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=haraldnordgren@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    --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.
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 NNTP newsgroup(s).