# Re: Question on rerere

4 messages from 2006-12-19 to 2006-12-20. Participants: Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/43357

## Johannes Schindelin, 2006-12-19 23:53

Subject: Question on rerere
Message-ID: <Pine.LNX.4.63.0612200045490.19693@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0612200045490.19693%40wbgn013.biozentrum.uni-wuerzburg.de

```
Hi,

while studying the code of rerere I found myself wondering if the code of 
compute_conflict_name and record_preimage is correct.

IIUC then each conflict hunk is handled _separately_ like this: the 
lexicographically smaller between the two file sections is displayed 
first, regardless if a previous hunk had a different order. Not that it 
matters most of the time, but isn't this dangerous?

Ciao,
Dscho

```

## Junio C Hamano, 2006-12-20 00:41

Subject: Re: Question on rerere
Message-ID: <7vk60no0ua.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vk60no0ua.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0612200045490.19693@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> IIUC then each conflict hunk is handled _separately_ like this: the 
> lexicographically smaller between the two file sections is displayed 
> first, regardless if a previous hunk had a different order. Not that it 
> matters most of the time, but isn't this dangerous?

You are probably right.  Probably the right thing would be to
use the first hunk to determine the flipping order and stick to
that for the rest.

Not that I've seen problems with the current behaviour, though.

```

## Junio C Hamano, 2006-12-20 01:29

Subject: Re: Question on rerere
Message-ID: <7vy7p3mk1i.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vy7p3mk1i.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7vk60no0ua.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> IIUC then each conflict hunk is handled _separately_ like this: the 
>> lexicographically smaller between the two file sections is displayed 
>> first, regardless if a previous hunk had a different order. Not that it 
>> matters most of the time, but isn't this dangerous?
>
> You are probably right.  Probably the right thing would be to
> use the first hunk to determine the flipping order and stick to
> that for the rest.
>
> Not that I've seen problems with the current behaviour, though.

Well, come to think of it, I think the current behaviour makes
more sense.

Suppose you start from an original file "OO".  You have two
branches that change it to "AO" and "BO", and another pair of
branches that change it to "OC" and "OD".  Let's call these
branches A, B, C, and D.

By merging A and C, you will get "AC"; you can get "AD", "BC"
and "BD" the same way.

Now suppose you are on "AC" and merged "BD".  You would get
"<A=B><C=D>".

If you were on "BD" and merged "AC" you would get "<B=A><D=C>".
If you were on "AD" and merged "BC" you would get "<A=B><D=C>".

You got the idea?






```

## Johannes Schindelin, 2006-12-20 01:40

Subject: Re: Question on rerere
Message-ID: <Pine.LNX.4.63.0612200240360.19693@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0612200240360.19693%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vy7p3mk1i.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Tue, 19 Dec 2006, Junio C Hamano wrote:

> Junio C Hamano <junkio@cox.net> writes:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> >> IIUC then each conflict hunk is handled _separately_ like this: the 
> >> lexicographically smaller between the two file sections is displayed 
> >> first, regardless if a previous hunk had a different order. Not that it 
> >> matters most of the time, but isn't this dangerous?
> >
> > You are probably right.  Probably the right thing would be to
> > use the first hunk to determine the flipping order and stick to
> > that for the rest.
> >
> > Not that I've seen problems with the current behaviour, though.
> 
> Well, come to think of it, I think the current behaviour makes
> more sense.
> 
> Suppose you start from an original file "OO".  You have two
> branches that change it to "AO" and "BO", and another pair of
> branches that change it to "OC" and "OD".  Let's call these
> branches A, B, C, and D.
> 
> By merging A and C, you will get "AC"; you can get "AD", "BC"
> and "BD" the same way.
> 
> Now suppose you are on "AC" and merged "BD".  You would get
> "<A=B><C=D>".
> 
> If you were on "BD" and merged "AC" you would get "<B=A><D=C>".
> If you were on "AD" and merged "BC" you would get "<A=B><D=C>".
> 
> You got the idea?

Yes. Thanks!

Ciao,
Dscho

```
