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

Re: Octopus? Really? Interesting...

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 4, 2008, 22:42 UTC
Message-ID
<7vhchti55a.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1199471321.3133.22.camel@ld0161-tx32>
Jon Loeliger <jdl@freescale.com> writes:
Show 7 quoted lines
> Couple questions:
>
>     Is it ever NOT the case, that if you are on one
>     branch ("master") and name it as a "to be merged"
>     branch along with some others, that we can simplify
>     the request by noting that it is the same as the
>     current "to be merged into" target branch?

Yes we can, but "filter ancestors out from the remotes" computation does not happen before the merge strategy is chosen.

>     Other than creating a log message with "merged
>     by octopus", will this merge be content-identical
>     to the obvious simplified merge?

I think octopus actually tries to be careful not to run the read-tree 3-way merge when merging a true ancestor (see ll.77-87 in git-merge-octopus.sh, but see below), so the resulting tree should be identical to "-s resolve" merge.

But that does not mean the user's wish to record such a commit as one ancestor should not be honored, and I think there actually is a benign bug there. Due to the "Already up-to-date with $SHA1" part, the codepath that says "Fast forwarding to:" never actually triggers, so in practice we end up dropping any true ancestor from the parent list of the resulting merge. That contradicts the comment in ll.77-87 that suggests we try not to outsmart the user who told us to create such an octopus for unfathomable reason ;-)

Previous: Jon Loeliger
Message 2 of 2 in “Octopus? Really? Interesting...”
  1. Jon LoeligerJan 4, 2008
  2. Junio C HamanoJan 4, 2008

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.