[Top][All Lists]

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

Re: cvs merging - conflict

From: Kaz Kylheku
Subject: Re: cvs merging - conflict
Date: Thu, 17 Jun 2004 08:41:08 -0700 (PDT)

On Thu, 17 Jun 2004, Feldmann, Rick wrote:

> I read somewhere that cvs update uses diff to figure out modifications to
> the files.  

The merging algorithm is based on the three-way merge program diff3. 

> However, it doesn't appear to use the same diff as cvs diff -

That's correct. diff and diff3 are diff-erent animals. 

> Part of it is the white space issue, and there doesn't appear to be and
> option in update to ignore white space.

That wouldn't make sense. Ignoring any differences would cause update
to become unreliable.

Suppose that developer A commits a bugfix in some programming language
where whitespace is significant. The bugfix changes a file in
whitespace only. Developer B runs cvs update, which decides that the
fix is not important and so doesn't incorporate it into his working
copy. Oops!

The machine can't blindly throw away information in the output when
computing a merged version.  The output of a merge operation is a new
working copy which will eventually make it back to the repository.

Ignoring whitespace differences in the output of diff is okay, because
such diffs are just for human consumption; they don't serve as input
back into the machine. For instance, such diffs can't be trusted to be
useful as patches.

If in a C program I change  #define x ()  to #define x(),  then a patch
produced with diff -ub will miss that change! Consequently, someone
applying the patch won't get the correct bugfix.

reply via email to

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