[cvsnt] Why is this a conflict?

Jeff Urlwin jurlwin at esoftmatic.com
Fri Jan 16 12:35:46 GMT 2004


> 
> On 2004-01-14, Jeff Urlwin <jurlwin at esoftmatic.com> wrote:
> >  Hmmm...I'm sure there are plenty of examples both ways, 
> but: if you 
> > are both  Appending to a file, wouldn't that be ok to 
> append both?  It 
> > seems like that  would be a good enhancement for certain types of 
> > files (flagged via
> >  wrappers?)
> 
> Here's an example:
>     --- Initial file ---
>     The most important people in this company are (in 
> ascending order):
>     Fred Smith
>     Peter Jones
>     Arthur Miggings
>     ---
> 
> Now, I edit it by appending a bit:
>     --- Phil's file ---
>     The most important people in this company are (in 
> ascending order):
>     Fred Smith
>     Peter Jones
>     Arthur Miggings
>     Phil Richards
>     ---
> 
> And you edit it at the same time:
>     --- Jeff's file ---
>     The most important people in this company are (in 
> ascending order):
>     Fred Smith
>     Peter Jones
>     Arthur Miggings
>     Jeff Urlwin
>     ---
> 
> CVS will highlight a merge conflict for one of us:
>     --- Merged file ---
>     The most important people in this company are (in 
> ascending order):
>     Fred Smith
>     Peter Jones
>     Arthur Miggings
>     <<<<<<<
>     Jeff Urlwin
>     =======
>     Phil Richards
>     >>>>>>>
>     ---
> 
> Do you *really* want CVS to automatically resolve that conflict?
> 

Actually, I do (and I should be at the top ;).  Here's another examples:

Error.msg.foo=There has been a severe application error
Error.msg.bar=There has been an error processing your request.
Field.LastName.tag=Last Name
Field.FirstName.tag=First Name

Now, developer 1 adds:
Field.MiddleName.tag=Middle Name

Developer two adds
Field.Search.tag=Search

They *both* should be in the file.

Also, consider a C file:

#include <stdio.h>

int foo(int bar) {
   printf("Hello World\n");
}

--- end here

Developer 1 *adds* function bar while Developer two *adds* function bletch.


In one case, let's say they accidentally add the same function name.  Then,
the compiler will/should catch the conflict and both pieces of code will be
there.  But if they both add two different functions, I'd like to have it
add both.  

The reason is, especially when people are new to CVS and used to the strict
locking, conflicts cause more anxiety, etc.  I think it gets better as you
get used to it, but people still say: hey, I'm doing this this, can you
wait.  If there were no conflict for adds to the end of a file, it would
allow multiple people to add things to shared files.

The application.properties file may be the ultimate special case (a
Java/Struts thing for adding messages to a properties file instead of
sprinkling them through your code).

Jeff





More information about the cvsnt mailing list