Re: [PATCH] rerere should not repeat the earlier hunks in later ones

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

 



Hi,

On Wed, 4 Apr 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> 
> >> > @@ -112,7 +112,8 @@ static int handle_file(const char *path,
> >> >  		else if (!prefixcmp(buf, ">>>>>>> ")) {
> >> >  			hunk_no++;
> >> >  			hunk = 0;
> >> > -			if (memcmp(one->ptr, two->ptr, one->nr < two->nr ?
> >> > +			if (one->nr > two->nr || memcmp(one->ptr, two->ptr,
> >> > +						one->nr < two->nr ?
> >> >  						one->nr : two->nr) > 0) {
> >> >  				struct buffer *swap = one;
> >> >  				one = two;
> >> >
> >> > in case that one conflicting region is prefix of the other one.
> >> 
> >> If one is not a prefix of two but simply longer what does that
> >> code do?
> >
> > You're right. With the eager merging algorithm, it is no longer possible 
> > that one side is a strict prefix of the other.
> >
> > So please forget about my comment.
> 
> Now you confused me even more...
> 
> Isn't there a case where one is full of text and two is empty?

If one is empty, yes, there can be a conflict. I only did not think of the 
empty string as a prefix to everything, but you are right.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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