From: Michael Haggerty <mhagger@alum.mit.edu>
To: Jakub Narebski <jnareb@gmail.com>, Derrick Stolee <stolee@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>,
Jeff Hostetler <git@jeffhostetler.com>,
Jacob Keller <jacob.keller@gmail.com>,
Stefan Beller <sbeller@google.com>,
Elijah Newren <newren@gmail.com>
Subject: Re: commit-graph: change in "best" merge-base when ambiguous
Date: Fri, 25 May 2018 08:03:43 +0200 [thread overview]
Message-ID: <1fb58851-57bc-b787-fd38-474aa6afa8b3@alum.mit.edu> (raw)
In-Reply-To: <86o9h41zc3.fsf@gmail.com>
On 05/25/2018 12:08 AM, Jakub Narebski wrote:
> Derrick Stolee <stolee@gmail.com> writes:
>> On 5/22/2018 1:39 AM, Michael Haggerty wrote:
>>> On 05/21/2018 08:10 PM, Derrick Stolee wrote:
>>>> [...]
>>> This may be beyond the scope of what you are working on, but there are
>>> significant advantages to selecting a "best" merge base from among the
>>> candidates. Long ago [1] I proposed that the "best" merge base is the
>>> merge base candidate that minimizes the number of non-merge commits that
>>> are in
>>>
>>> git rev-list $candidate..$branch
>>>
>>> that are already in master:
>>>
>>> git rev-list $master
>>>
>>> (assuming merging branch into master), which is equivalent to choosing
>>> the merge base that minimizes
>>>
>>> git rev-list --count $candidate..$branch
>
> Is the above correct...
>
>>> In fact, this criterion is symmetric if you exchange branch ↔ master,
>>> which is a nice property, and indeed generalizes pretty simply to
>>> computing the merge base of more than two commits.
>
> ...as it doesn't seem to have the described symmetry.
The first email that I referenced [1] demonstrates this in the section
"Symmetry; generalization to more than two branches". The same thing is
demonstrated in a simpler way using set notation in a later email in
that thread [2].
Michael
[1] https://public-inbox.org/git/539A25BF.4060501@alum.mit.edu/
[2] https://public-inbox.org/git/53A06264.9080205@alum.mit.edu/
prev parent reply other threads:[~2018-05-25 6:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 18:10 commit-graph: change in "best" merge-base when ambiguous Derrick Stolee
2018-05-21 18:33 ` Elijah Newren
2018-05-21 21:50 ` Jeff King
2018-05-21 22:28 ` Stefan Beller
2018-05-21 21:54 ` Jeff King
2018-05-21 22:25 ` Jacob Keller
2018-05-22 5:39 ` Michael Haggerty
2018-05-22 12:48 ` Derrick Stolee
2018-05-24 22:08 ` Jakub Narebski
2018-05-25 6:03 ` Michael Haggerty [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
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=1fb58851-57bc-b787-fd38-474aa6afa8b3@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.com \
--cc=jnareb@gmail.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=sbeller@google.com \
--cc=stolee@gmail.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).