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

Re: Bug in merge-base

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Apr 19, 2005, 23:07 UTC
Message-ID
<Pine.LNX.4.21.0504191853310.30848-100000@iabervon.org>
In-Reply-To
<20050419223420.GF9305@pasky.ji.cz>
On Wed, 20 Apr 2005, Petr Baudis wrote:
Show 13 quoted lines
> Dear diary, on Wed, Apr 20, 2005 at 12:17:12AM CEST, I got a letter
> where Daniel Barkalow <barkalow@iabervon.org> told me that...
> 
> > I can think of. Are you sure there isn't another path to 5b53d3?
> 
> I'm not. Actually there well might be.
> 
> I think merge-base should never take a path which is effectively
> "upside-down" when a straight "upside" one is available.
> 
> Hmm. So what I depended on for merge-base was that when doing it on A
> and B and A is predecessor of B, then it will always just return A.  I
> will perhaps need to abuse rev-tree somehow for this then, it looks.

It is currently optimizing for the shortest longer path, but I guess it should optimize for the shortest shorter path (i.e., the 0-length path from A to itself always wins).

On the other hand, the date-based comparison (which you'd get with the version I sent yesterday with [2/4] and [4/4]) would give you the most recent common ancestor, which would necessarily avoid this situation.

Do you want to go with the date-based approach, or should I work out a shortest shorter path algorithm?

	-Daniel
*This .sig left intentionally blank*
Message 1 of 1 in “Re: Bug in merge-base”
  1. Daniel BarkalowApr 19, 2005

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.