git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Tiago Botelho <tiago@gitlab.com>
Cc: Christian Couder <christian.couder@gmail.com>,
	Harald Nordgren <haraldnordgren@gmail.com>,
	Stefan Beller <sbeller@google.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] Create '--merges-only' option for 'git bisect'
Date: Thu, 12 Apr 2018 13:53:46 +0200 (DST)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1804121341590.65@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz> (raw)
In-Reply-To: <CAF2Guqum5dak4us_HJtiW_gL0xgsihgUpidFEJzBgw-tEMunkQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3309 bytes --]

Hi Tiago,

On Thu, 12 Apr 2018, Tiago Botelho wrote:

> On Thu, Apr 12, 2018 at 9:58 AM, Christian Couder
> <christian.couder@gmail.com> wrote:
> > On Thu, Apr 12, 2018 at 9:49 AM, Harald Nordgren
> > <haraldnordgren@gmail.com> wrote:
> >> I think it looks similar. But if I'm reading that thread correctly
> >> then there was never a patch created, right?
> >
> > (It is customary on this mailing list to reply after the sentences we
> > reply to. We don't "top post".)
> >
> > On the GSoC idea pages (like https://git.github.io/SoC-2018-Ideas/) we
> > have been suggesting "Implement git bisect --first-parent" and there
> > are the following related links:
> >
> > https://public-inbox.org/git/20150304053333.GA9584@peff.net/
> > https://public-inbox.org/git/4D3CDDF9.6080405@intel.com/
> >
> > Tiago in Cc also tried at a recent London hackathon to implement it
> > and came up with the following:
> >
> > https://github.com/tiagonbotelho/git/pull/1/files
> >
> > I tried to help him by reworking his commit in the following branch:
> >
> > https://github.com/chriscool/git/commits/myfirstparent
> 
> Thank you for the cc Christian, I’ve been quite busy and was not able
> to work on the PR for quite some time.
> 
> I intended to pick it back up again next week. If it is ok with Harald
> I would love to finish the PR that I started,
> since it is quite close to being finished (I think it was just specs
> missing if I am not mistaken).

That looks promising. Just like I suggested to Harald in another reply
[*1*] on this thread, you probably want to use `int flags` instead, and
turn `find_all` into BISECT_FIND_ALL in a preparatory commit.

Also, you will definitely want to add a test. Again, my reply to Harald
[*1*] should give you a head start there... You will want to imitate the
test case I outlined there, maybe something like:

# A - B - C - F
#   \   \   /   \
#     D - E - G - H

[... 'setup' as in my mail to Harald ...]

test_expect_success '--first-parent' '
	write_script find-e.sh <<-\EOF &&
	case "$(git show --format=%s -s)" in
	B|C|F) ;; # first parent lineage: okay
	*) git show -s --oneline HEAD >unexpected;;
	esac
	# detect whether we are "before" or "after" E
	test ! -f E.t
	EOF

	git bisect start --first-parent HEAD A &&
	git bisect run ./find-e.sh >actual &&
	test_path_is_missing unexpected &&
	grep "$(git rev-parse F) is the first bad commit" actual
'

Also, Tiago, reading through your patch (as on chriscool/git; do you have
your own fork? That would make it much easier to collaborate with you by
offering PRs), it looks more straight-forward than editing the commit_list
after the fact and adding magic weights ;-)

Except for one thing. I wonder why `bisect_next_all()` does not set
revs.first_parent_only after calling `bisect_rev_setup()`? You would still
need the changes in `count_distance()`, as it performs its own commit
graph traversal, but there is no need to enumerate too many commits in the
first place, right?

Harald, maybe --merges-only can be implemented on top of --first-parent,
with the `int flags` change I suggested?

Ciao,
Johannes

Footnote *1*:
https://public-inbox.org/git/nycvar.QRO.7.76.6.1804121143120.65@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz/

  reply	other threads:[~2018-04-12 11:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 22:55 [PATCH] Create '--merges-only' option for 'git bisect' Harald Nordgren
2018-04-11 23:33 ` Stefan Beller
2018-04-12  7:49   ` Harald Nordgren
2018-04-12  8:58     ` Christian Couder
2018-04-12  9:27       ` Tiago Botelho
2018-04-12 11:53         ` Johannes Schindelin [this message]
2018-04-12 12:19           ` Tiago Botelho
2018-04-30 11:31             ` Johannes Schindelin
2018-04-30 11:34               ` Tiago Botelho
2018-05-01 11:31                 ` Johannes Schindelin
2018-04-12 11:35   ` Johannes Schindelin
2018-04-12 11:33 ` Johannes Schindelin

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.1804121341590.65@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz \
    --to=johannes.schindelin@gmx.de \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=haraldnordgren@gmail.com \
    --cc=sbeller@google.com \
    --cc=tiago@gitlab.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).