merge-ort and --rebase-merges, was Re: [PATCH v2 0/7] Drop support for git rebase --preserve-merges
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 13, 2021, 11:24 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2109131319020.55@tvgsbejvaqbjf.bet>
- In-Reply-To
- <CABPp-BHWVO5VRhr1-Ou60F1wjKzJZ1e_dC01Mmzs+qB9kGayww@mail.gmail.com>
Hi Elijah,
On Fri, 10 Sep 2021, Elijah Newren wrote:
Show 17 quoted lines
> On Fri, Sep 10, 2021 at 5:08 AM Johannes Schindelin > <Johannes.Schindelin@gmx.de> wrote: > > > > On Tue, 7 Sep 2021, Elijah Newren wrote: > > > > > On Tue, Sep 7, 2021 at 11:51 AM Johannes Schindelin > > > <Johannes.Schindelin@gmx.de> wrote: > > > > > > [... talk about re-resolving merge conflicts when recreating merges > > > in a `git rebase --rebase-merges` run ...] > ... > > > > While I agree that `merge-ort` makes a lot of things much better, I think > > in this context we need to keep in mind that those nested merge conflicts > > can really hurt. > > Yes, and I'm not sure you fully appreciate how much either.
*grin*
Show 100 quoted lines
> [... a lot of insight that I totally agree with ...]
>
> I believe the commit graph you were describing was this:
>
> * rebase-of-original-merge
> |\
> | * rebase-of-local-add-caller-of-core
> * | rebase-of-local-rename-to-hi
> |/
> * upstream
> |
> |
> |
> | * original-merge
> | |\
> | | * local-add-caller-of-core
> | |/
> |/|
> | * local-rename-to-hi
> |/
> * initial-version
>
>
> Further, the versions of main.c in each of those are as follows:
>
> ==> initial-version:
> int core(void) {
> printf("Hello, world!\n");
> }
>
>
> ==> local-rename-to-hi:
> int hi(void) {
> printf("Hello, world!\n");
> }
>
>
> ==> local-add-caller-of-core:
> int core(void) {
> printf("Hello, world!\n");
> }
> /* caller */
> void caller(void) {
> core();
> }
>
>
> ==> what an automatic merge of the two local-* branches would give:
> int hi(void) {
> printf("Hello, world!\n");
> }
> /* caller */
> void caller(void) {
> core();
> }
>
>
> ==> original-merge (amended from above by s/core/hi/ in caller()):
> int hi(void) {
> printf("Hello, world!\n");
> }
> /* caller */
> void caller(void) {
> hi();
> }
>
>
> ==> upstream:
> int greeting(void) {
> printf("Hello, world!\n");
> }
> /* main event loop */
> void event_loop(void) {
> /* TODO: place holder for now */
> }
>
>
> ==> rebase-of-local-rename-to-hi (kept 'hi' over 'greeting'):
> int hi(void) {
> printf("Hello, world!\n");
> }
> /* main event loop */
> void event_loop(void) {
> /* TODO: place holder for now */
> }
>
>
> ==> rebase-of-local-add-caller-of-core (kept both new functions,
> updated caller):
> int greeting(void) {
> printf("Hello, world!\n");
> }
> /* main event loop */
> void event_loop(void) {
> /* TODO: place holder for now */
> }
> /* caller */
> void caller(void) {
> greeting();
> }That all matches my recollection of what I wanted to drive at.
Show 21 quoted lines
> If I've understood that all correctly, then my idea will give you the
> following conflict to resolve:
>
> ==> rebase-of-original-merge, before conflict resolution:
> int hi(void) {
> printf("Hello, world!\n");
> }
> /* main event loop */
> void event_loop(void) {
> /* TODO: place holder for now */
> }
> /* caller */
> void caller(void) {
> <<<<<<< HEAD
> greeting();
> ||||||| auto-remerge of original-merge
> core();
> =======
> hi();
> >>>>>>> original-merge
> }That looks very intriguing! I would _love_ to play with this a bit, and I think you provided enough guidance to get going. I am currently preparing to go mostly offline for the second half of September, read: I won't be able to play with this before October. But I am definitely interested, this sounds very exciting.
Ciao, Dscho