[Top][All Lists]

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

Re: Can I turn off merge conflict markers?

From: Paul Sander
Subject: Re: Can I turn off merge conflict markers?
Date: Thu, 10 Feb 2005 11:04:26 -0800

Still another method, not for the faint at heart, is to apply my patch from September 2001 that allows a site to install their own merge tools. Perhaps even easier would be to read the name of the diff3 program from an environment variable. Then install a wrapper that does what you want.

On Feb 10, 2005, at 9:08 AM, address@hidden wrote:

Todd Denniston wrote:
"Mark E. Hamilton" wrote:
address@hidden wrote:
When you get a file where automatic merge fails
CVS will report a merge conflict and then modify
the offending file with conflict markers:
...which is fine most of the time, but now I have a situation

I believe Mark's responses are correct, but you might be able to use some
other commands to deal with it the way you want.
1. make separate lists of files with and without conflicts (look for C in
the output of update).
 cvs -n update 2>&1 | \
process_to_separate_filenames_with_conflicts 2. just update those without conflicts.
   for i in `cat files_without_conflicts`; \
   do cvs update $i;done
3. do something special for the ones with conflicts.
   for i in `cat files_with_conflicts`; \
   do marks_method_1or2 $i;done
marks_method_3 is the only known correct method, but your situation might be

A fourth approach would be to do the 'cvs update' to merge everything that can be merged successfully, and then use something like this to automatically select one of the two choices in the conflict lines:

for file in $(cvs -q update | egrep '^C' | cut -f2 -d' ')
 # Pick one of these two sed commands.

# This will discard the repository changes and keep the project changes
 sed -e '/^=======/,/^>>>>>>>/d' -e '/^<<<<<<</d' ${file} > blarg \
   && mv blarg ${file}

# This will discard the project changes and keep the respository changes
 sed -i -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d' ${file} > blarg \
   && mv blarg ${file}

Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.

Info-cvs mailing list

Paul Sander       | "To do two things at once is to do neither"
address@hidden | Publilius Syrus, Roman philosopher, 100 B.C.

reply via email to

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