[Top][All Lists]

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

Re: Merging in CVS

From: Kaz Kylheku
Subject: Re: Merging in CVS
Date: Fri, 22 Nov 2002 10:58:54 -0800 (PST)

On Fri, 22 Nov 2002, MacMunn, Robert wrote:
> > On Fri, Nov 22, 2002 at 12:23:56 -0500, MacMunn, Robert sent 0.9K bytes:
> > > Thanks.  Looks like merges must be difficult in CVS.  A lot of manual
> > work.
> > 
> > Most of the time, merges happen automatically.  Manual intervention is
> > only required when they can't happen automatically. Conflicts always
> > take (some amount) of a manual work. Merges never do.  I don't see how
> > you can get around this fact in any system, short of exclusivity.
> > 
> > Looks like you may be confused by terminology. RTFM.
> Not at all.  In Clearcase you have a graphical interface where the conflicts
> can be taken care of as the merge happens.  

It's debatable whether taking care of conflicts before the entire merge 
operation is complete is a good idea compared to getting the entire
merge and then working on it.

There are graphical interfaces for merging that can be used with CVS,
if you would rather click on the left text or right text than use an

> No manual editting of files.

That is only the case when the resolution of the conflict is a trivial
choice between the left and the right version. Sometimes a conflict
must be some combination of the two, and so editing is required.

Note that you could write a trivial shell script to read a text file,
look for the <<<<<<<=======>>>>>>> delimited sections and present you
with a simple menu to pick the left or the right text, or bring up a
text editor to do the edit. Then a script above that could look for the
conflicting files, and invoke the resolver on them one by one. Here is
a sketch of the main loop:

  while read line ; do
    # do some tokenizing
    case first_token in
      <<<<<<< )
        # ... logic to start collection of left text to a temporary file
      ======= )
        # ... start collection of right text to temporary file
      >>>>>>> )
        # ... call user-friendly resolution menu function
      * )
        # write line to appropriate output file: left, right or main.
  done < file

Lastly, if you really want ClearCase, you know where you can get it! 

reply via email to

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