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

Re: merge-base --is-ancestor A B is unreasonably slow with unrelated history B

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 9, 2018, 19:13 UTC
Message-ID
<xmqq7esq6e2g.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<87608bawoa.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> This is obviously a pathological case, but maybe we should work slightly
> harder on the RHS of and discover that it itself is an orphan commit.

In order to discover a commit is an orphan, you'd need to prove not just that it does not reach the main part of the history (which is cheap---its parenthood network would be quite limited and traversing all of it is not that expensive) but the other way around, i.e. the main part of the history would not reach it.

Do you have a cheaper way to do the latter than a full traveral of the main history? If not, then the cost similar to "git log master" is expected.

Previous: Ævar Arnfjörð BjarmasonNext: Derrick Stolee
Message 2 of 4 in “merge-base --is-ancestor A B is unreasonably slow with unrelated history B”
  1. Ævar Arnfjörð BjarmasonJan 9, 2018
  2. Junio C HamanoJan 9, 2018
  3. Derrick StoleeJan 9, 2018
  4. Ævar Arnfjörð BjarmasonJan 10, 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.