Empty merges

Krzysztof Nowicki krissn at op.pl
Sun Feb 15 20:59:02 GMT 2009


Marius Gedminas pisze:
> On Wed, Feb 04, 2009 at 06:54:57AM +0100, Krzysztof Nowicki wrote:
>> I'm trying to setup two Bazaar shared repositories to work similar to a
>> ClearCase Multisite setup. Both repositories mirror themselves, but
>> selected branches are owned by each of the site and mirrored read-only
>> on the other site. The changes from that branch is merged to the main
>> branch of the site. For example:
>>
>> site1/
>> site1/dev_site1
>> site1/dev_site2
>>
>> site2/
>> site2/dev_site1
>> site2/dev_site2
>>
>> I did an initial commit to site1/dev_site1 and pushed the revision to
>> site2/dev_site1, then pushed site2/dev_site1 to site2/dev_site2 and
>> finally site2/dev_site2 to site1/dev_site2. After that I had all four
>> branches having the same revision and the same files. Trying to do a
>> merge from site1/dev_site2 to site1/dev_site1 showed that there is
>> nothing to do.
>>
>> Next I commited a change on site1/dev_site1 and tried to propagate it.
>> So what I did was:
>>  1. pushed site1/dev_site1 -> site2/dev_site1
>>  2. merged site2/dev_site1 -> site2/dev_site2
>>  3. pushed site2/dev_site2 -> site1/dev_site1
>>
>> Now I'd expect all branches to again have the same contents, however
>> when I tried to merge site1/dev_site2 -> site1/dev_site1 the merge
>> started. Although there were no file differencies the merge was
>> recorded. If I had this automated, the brancg site1/dev_site1 would now
>> be pushed to site2/dev_site1 and then the empty merge would start on the
>> other end. This would result in an endless loop of empty merges.
>>
>> Is this an expected behaviour or some sort of bug?
> 
> I was eagerly waiting for an answer, but, since none seems to be
> forthcoming, I'll try answering it.
> 
> I think it's expected behaviour.  I personally dislike it, but I'm sure
> people may argue it's just a corner case of something that has a
> perfectly good logical reason to be that way.
> 
> Marius Gedminas

Thanks for the reply :)

I'd rather expect a VCS to refuse an empty merge (with some optional
--force argument telling it to do what it's asked to do and not to argue
any more).

This is not a blocking issue, however in order to prevent such an
endless loop the merge script will need to first do a diff or a status
in order to determine if there is anything to merge.

Krzysztof Nowicki






More information about the bazaar mailing list