merge-ort and --rebase-merges, was Re: [PATCH v2 0/7] Drop support for git rebase --preserve-merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Elijah,

On Fri, 10 Sep 2021, Elijah Newren wrote:

> On Fri, Sep 10, 2021 at 5:08 AM Johannes Schindelin
> <Johannes.Schindelin@xxxxxx> wrote:
> >
> > On Tue, 7 Sep 2021, Elijah Newren wrote:
> >
> > > On Tue, Sep 7, 2021 at 11:51 AM Johannes Schindelin
> > > <Johannes.Schindelin@xxxxxx> 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*

> [... 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.

> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux