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

Re: [GIT PULL] GPIO bulk changes for kernel v4.6

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 18, 2016, 17:01 UTC
Message-ID
<CA+55aFzVqPzEg6zq7sRweE7OCVKMJzM1eZRHXddMG+BabEDeCA@mail.gmail.com>
In-Reply-To
<xmqqr3f7rbck.fsf@gitster.mtv.corp.google.com>
On Fri, Mar 18, 2016 at 9:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>
>> I don't think the original "resolve" did it, for example. You can't do
>> a three-way merge without a base.
>
> Yes, and that continues to this day:
Yeah, "octopus" also refuses it cleanly:
        common=$(git merge-base --all $SHA1 $MRC) ||
                die "Unable to find common commit with $pretty_name"
The code in the recursive merge that allows this to happen is this:
        if (merged_common_ancestors == NULL) {
                /* if there is no common ancestor, use an empty tree */
                struct tree *tree;
                tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
                merged_common_ancestors = make_virtual_commit(tree, "ancestor");
        }
so the "no common ancestors" is just considered to be an empty merge base.
And I do think that's right, and I think it's clever, and it goes back to 2006:
  934d9a24078e merge-recur: if there is no common ancestor, fake empty one
but I think there should be an option there.
> This is a tangent but I wonder if we should say why we refuse to
> the standard error before calling these two "exit"s.
As mentioned, Octopus does.

That said, there's probably no reason to ever use the old three-way merge, so I'm not even sure it's worth fixing the old git-merge-resolve.

            Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “Re: [GIT PULL] GPIO bulk changes for kernel v4.6”
  1. Linus TorvaldsMar 18, 2016
  2. Johannes SchindelinMar 18, 2016
  3. Junio C HamanoMar 18, 2016
  4. Linus TorvaldsMar 18, 2016
  5. Junio C HamanoMar 18, 2016
  6. Linus TorvaldsMar 18, 2016
  7. Junio C HamanoMar 18, 2016

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.