bug-cvs
[Top][All Lists]
Advanced

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

Re: CVS merge issue: "cvs update -j -j"


From: Glen Wolfe
Subject: Re: CVS merge issue: "cvs update -j -j"
Date: Mon, 31 Mar 2003 14:45:51 +1000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3

Hi guys

Excuse me for intruding on your discussion .... I am a colleague of Frederic's and was interested in your reply, BJ (I hope you don't mind the abbreviation ) ...

I am trying to reconcile my image of the merge process with the balancing concepts you use.

The image in my mind of the merge (from our use of it I guess) is something like:

                  0  Initial revision
                  |
                  |
                  0  RevA
                  |\
                  | \
                  |  ------------0  RevB
                  |              |
                  |              |
                  |              |
                  |              0  RevD     
                  |              |          
                  |              |          
                  |              |
                  |              0  RevE     a
                  |              |           b
                  |              |           c
                  |              |          
                  |              |          
                  |              |          
                  |              0  RevF     a
                  |              |           b
                  |              |           c
                  |              |           d
                  |              |           e
                  |              |
                  0  RevC  a     0  RevG    
                                             
                                             

Our objective is to take the change between RevE and RevF and apply it to RevC
- as we understand, to merge the delta from RevE to RevF with RevC
- cvs update -jRevE -jRevF


From what I understand you to say, the situation could be one of two general cases, either:

CASE #1

                  0  Initial revision
                  |
                  |           x
                  |           y
                  |           z
                  0  RevA     a
                  |\          b
                  | \         c 
                  |  ------------0  RevB
                  |              |
  transition is   |              |--- transition is to remove lines x,y,z, replace line b with p
  to remove    ---|              |    and add lines q,r
  lines x,y,z,b,c |              0  RevD     a
                  |              |           p
                  |              |           c      --- transition is to replace line p with b
                  |              |           q          and remove lines q,r
                  |              |           r
                  |              |
                  |              0  RevE     a
                  |              |           b
                  |              |           c
                  |              |                  --- transition is to add lines d,e
                  |              |          
                  |              |          
                  |              0  RevF     a
                  |              |           b
                  |              |           c
                  |              |           d
                  |              |           e
                  |              |
                  0  RevC  a     0  RevG


or

CASE #2

                  0  Initial revision
                  |
                  |          
                  |           a
                  |           x
                  0  RevA     y
                  |\          z
                  | \          
                  |  ------------0  RevB
                  |              |
  transition is   |              |--- transition is to remove lines x,y,z and add lines p,c,q,r
  to remove    ---|              |
  lines x,y,z     |              0  RevD     a
                  |              |           p
                  |              |           c      --- transition is to replace p with b
                  |              |           q          and remove lines q,r
                  |              |           r
                  |              |
                  |              0  RevE     a
                  |              |           b
                  |              |           c
                  |              |                  --- transition is to add lines d,e
                  |              |          
                  |              |          
                  |              0  RevF     a
                  |              |           b
                  |              |           c
                  |              |           d
                  |              |           e
                  |              |
                  0  RevC  a     0  RevG


In our use of the function,we wish to transfer the functionality represented by the change from RevE to RevF without taking the functionality delivered as the changes from RevA to RevE.
 

I am having trouble seeing your point of view that the addition of lines b,c on one branch or the removal on the other makes any difference to the result. True, either may have been performed in error, but so may any of the other revision transitions which are not displayed as involved in this merge.

Can you help me to understand your idea of what the merge objectives are and how the path to each revision is important to you?

Frederic Gioanni writes:
Hi,

I have got some problems when merging delta between rev1 and rev2 into
my Working revision of a file using
cvs update -j rev1 -j rev2 file

I am using CVS 1.10 with diff3 2.7. The same problem occurs in the
latest version of CVS.

Let's say that the content of file:rev1 is:

a
b
c

Content of file:rev2 is:

a
b
c
d
e

Content of my working revision is:

a

When doing the merge, I am expecting 2 new lines and so I am expecting
the following conflict:

a
<<<<<<< file
=======
d
e
>>>>>>> rev2

When two changes conflict, a merge utility should add conflict markers
that show both of the changes. But the above file shows only one of
the changes, namely the addition of d and e. But it does not show the
deletion of b and c even though that deletion conflicted with the
other change.

I.e., the above file is biased in favor of one of the two new revisions
of the file. An analogy of this would be how newspapers often have a
policy that they will report both sides of an issue so as to be fair.
For example, if there is conflict between two senators, where one
senator offers a reason in support of a bill and another senator
offers a reason to be opposed to it, then to be fair, the newspaper
should quote both of the senators. If it quotes only one senator,
then reader might think that argument makes sense and the reader might
not know of any opposing arguments. If the reader knew about opposing
arguments he might change his mind.

This is analogous to how the person resolving the conflict in the
above file will not know that anyone deleted b and c. But suppose
that that deletion was a mistake. If only the person who is resolving
the conflict knew that someone deleted it, then he might realize that
that person made a mistake. The above file will not help him notice
that mistake which means the mistake would remain uncorrected. The
file below is better because it does show that someone may have
mistakingly deleted b and c.

However, "cvs up -j -j" ends with:

a
<<<<<<< file
=======
b
c
d
e
>>>>>>> rev2

When resolving the conflict, the user thinks that 4 lines were added
between rev1 and rev2 whereas only 2 lines were added.

Whenever one version of a file has some text which another file does
not have, it can always be interpreted in two ways: either someone
added the text to one file or someone deleted the text from the other
file. The user in your example is mistaken if he does not consider
both possibilities. When cvs made the file above, cvs did not imply
one interpretation over another. Therefore the user should likewise not
assume one interpretation must be the right one based on only seeing
the above file. However, the user will have other information which can
help him decide which interpretation is correct. Specially, the user
will remember what changes he made so he will know whether he added or
deleted anything. Knowing that will help him know if the other file
added or deleted anything. Therefore, he can figure out which
interpretation is correct. And if he forgets what changes he made, he
can ask cvs to show him the complete file of rev1. That will make it easy
to see whether these changes are additions or deletions.

So, in my opinion, CVS is acting correctly.
--
Enjoy!


Dr Glen Wolfe
Tools and Methods Engineer

Thales ATM

Melbourne Australia
wolfe_head
strength in elegance
beauty in intelligence

   - dig

reply via email to

[Prev in Thread] Current Thread [Next in Thread]