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

Re: Strange reachability inconsistency (apparently, at least...)

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2015, 06:44 UTC
Message-ID
<xmqq1tlhunxs.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPc5daW=OeNmPVMVWQvp3rfYzfV7z6c1=26E26y0SaRQH7JooA@mail.gmail.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> On Thu, Feb 19, 2015 at 7:03 AM,  <ydirson@free.fr> wrote:
>> I have a (fsck-clean) git tree in which for 2 commits A and B:
>>
>> * "git merge-base --is-ancestor A B" returns 0
>> * "git log B..A" returns a non-empty set of commits
>>
>> I get this behaviour with 2.3.0 as well as with 2.1.3 and 1.7.12.
>>
>> Is that a real bug or am I just misinterpreting something ?
>
> Sounds strange. Is it possible to share the repository (or an
> anonymised copy of it)?
Actually it does not sound all that strange.

I suspect that B is indeed a proper descendant of A, but you have commits with screwed-up committer timestamps between these two commits that break the cut-off heuristic used by log and reb-list.

Grab the output from "git rev-list B..A". These are supposed to be ahead of B (i.e. should not be reachable from B). Then look at the output from "git log B" (no lower bound) and see if these commits appear there, perhaps like:

    $ git rev-list B..A | sed -e 's/^/^/' >phantoms
    $ git log --format='%H %ct' B | grep -C2 -f phantoms

Hits from the latter "grep" would indicate that what the traversal B..A claimed that are not reachable from B contained some commits that are indeed reachable from B.

Previous: Junio C Hamano
Message 3 of 3 in “Strange reachability inconsistency (apparently, at least...)”
  1. ydirson@free.frFeb 19, 2015
  2. Junio C HamanoFeb 22, 2015
  3. Junio C HamanoFeb 23, 2015

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.