From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Tiago Botelho <tiagonbotelho@gmail.com>,
Christian Couder <christian.couder@gmail.com>,
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: Wed, 4 Jul 2018 12:26:32 +0200 (DST) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1807041224460.75@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqq36x0ndza.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Tue, 3 Jul 2018, Junio C Hamano wrote:
> Tiago Botelho <tiagonbotelho@gmail.com> writes:
>
> > git rev-list --first-parent --bisect-all F..E >revs &&
> > test_line_count = 9 revs &&
> > for rev in E e1 e2 e3 e4 e5 e6 e7 e8
> > do
> > grep "^$(git rev-parse $rev) " revs ||
> > {
> > echo "$rev not shown" >&2 &&
> > return 1
> > }
> > done &&
> > sed -e "s/.*(dist=\([0-9]*\)).*/\1/" revs >actual.dists &&
> > sort -r actual.dists >actual.dists.sorted &&
> > test_cmp actual.dists.sorted actual.dists
>
> The distance in the current graph might be all lower single-digits,
> but you need "sort -n -r" to be future-proof, as dist=10 would sort
> next to dist=1, perhaps in between dist=1 and dist=2.
>
> Another thing you missed in my message is that the above does not
> say what distance value each commit should be assigned in the
> history. Even though the grep loop makes sure that each of E, e1,
> ... e8 appears at least once, and line-count before that ensures
> that the output has 9 entries (and taken together, it guarantees
> that each of these appears not just "at least once", but also
> exactly once), nothing guarantees if they are getting relative
> distance correctly, as the sed strips a bit too much (and that
> relates to my earlier point why starting from a concrete expected
> output and explicitly discard the aspect of the output we do not
> care about before comparison---that way, we can easily tell when the
> code is _designed to_ discard too much).
From my point of view, this indicates that you want to set those exact
dist values in stone. I am not sure I follow that reasoning, as this
particular test case's purpose is to ensure that the `--first-parent`
option works with `--bisect`, not that the distance values match a fixed
expectation.
In short: I disagree that the *exact* values (beyond testing the order)
should be tested *here*.
Ciao,
Dscho
next prev parent reply other threads:[~2018-07-04 10:26 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
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 [this message]
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=nycvar.QRO.7.76.6.1807041224460.75@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).