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

Re: Beyond Merge and Rebase: The Upstream Import Approach in Git

From
Aleksander Korzyński <ak@akorzy.net>
Date
Aug 1, 2023, 09:17 UTC
Message-ID
<CADWu+UmjFiKa2h4qqumA-jOfEGvVnsV85bOTKgYhpQwYCf=VFw@mail.gmail.com>
In-Reply-To
<CADWu+UnvastFbWsjfHvJhvS1RBgD8M1LXuA2VMBMSkTqpiLS5w@mail.gmail.com>
Hi,

Thanks again for your responses, Junio and Johannes. I'm looking to implement the discussed structure in git. As the first step, I'd like to implement:

git merge -s theirs

The name of the `theirs` strategy above is inspired by the existing `ours` strategy. The command above is going to be the equivalent of the following three commands:

git merge --no-commit -s ours <commit> git read-tree --reset -u <commit> git commit --no-edit

The new command is going to be used to create the last "welding merge" at the end of the structure below:

     o---o---o---o---o  upstream/main
          \           \
           \           a'---b'---c'
            \                     \
             a---b---c-------------M main

The strategy above could be called "rebase & weld". The new command can also be used with the "weld & rebase" strategy described by Johannes:

   o---o---o---o---o  upstream/main
        \           \
         a---b---c---M---a'---b'---c' main

In addition, `git merge -s theirs` could be called `git weld`, which would make it shorter to type. What do you think?

Also, I'm thinking about the eventual interface for creating the entire structure. Perhaps "rebase & weld" could be created with the following command:

git rebase --weld
and "weld & rebase" with the following:
git rebase --pre-weld
What are your thoughts?

-- Best regards, Aleksander Korzynski

Previous: Aleksander KorzyńskiNext: Aleksander Korzyński
Message 8 of 9 in “Beyond Merge and Rebase: The Upstream Import Approach in Git”
  1. Aleksander KorzyńskiJul 11, 2023
  2. Junio C HamanoJul 11, 2023
  3. Aleksander KorzyńskiJul 13, 2023
  4. Johannes SchindelinJul 12, 2023
  5. Junio C HamanoJul 12, 2023
  6. Junio C HamanoJul 12, 2023
  7. Aleksander KorzyńskiJul 14, 2023
  8. Aleksander KorzyńskiAug 1, 2023
  9. Aleksander KorzyńskiJul 14, 2023

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.