git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: commit-graph: change in "best" merge-base when ambiguous

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
May 25, 2018, 06:03 UTC
Message-ID
<1fb58851-57bc-b787-fd38-474aa6afa8b3@alum.mit.edu>
In-Reply-To
<86o9h41zc3.fsf@gmail.com>
On 05/25/2018 12:08 AM, Jakub Narebski wrote:
Show 28 quoted lines
> 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/

Previous: Jakub Narebski
Message 10 of 10 in “commit-graph: change in "best" merge-base when ambiguous”
  1. Derrick StoleeMay 21, 2018
  2. Elijah NewrenMay 21, 2018
  3. Jeff KingMay 21, 2018
  4. Stefan BellerMay 21, 2018
  5. Jeff KingMay 21, 2018
  6. Jacob KellerMay 21, 2018
  7. Michael HaggertyMay 22, 2018
  8. Derrick StoleeMay 22, 2018
  9. Jakub NarebskiMay 24, 2018
  10. Michael HaggertyMay 25, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.