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 mainThe 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' mainIn 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