info-cvs
[Top][All Lists]
Advanced

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

Re: The idea isn't clear...


From: Eric Siegerman
Subject: Re: The idea isn't clear...
Date: Fri, 30 May 2003 12:36:21 -0400
User-agent: Mutt/1.2.5i

On Wed, May 28, 2003 at 07:29:58PM -0400, Greg A. Woods wrote:
> [ On Wednesday, May 28, 2003 at 15:24:09 (-0700), Jim wrote: ]
> > >>>>>>>
> > stuff
> >  =======
> > other stuff
> > <<<<<<<
> 
> It's one hell of a lot easier to tell what's going on with conflicts if
> you fix CVS to call "diff3" in such a way that it includes the full
> conflict information:

[reluctantly quoting almost the entire patch, since I don't see
how to edit it down...]

> $ cvs diff  rcscmds.c
> [...]
> ***************
> *** 245,254 ****
> --- 245,258 ----
>       char *tmp1, *tmp2;
>       char *diffout = NULL;
>       int retval;
> +     struct stat file_info;
>   
>       if (options != NULL && options[0] != '\0')
>         assert (options[0] == '-' && options[1] == 'k');
>   
> +     if (CVS_STAT (workfile, &file_info) < 0)
> +       error (1, errno, "could not stat %s", workfile);
> + 
>       cvs_output ("RCS file: ", 0);
>       cvs_output (rcs->path, 0);
>       cvs_output ("\n", 1);

I suspect that the above diff hunk is an unrelated change.  It
seems unrelated to the conflict-marking style.


> ***************
> *** 298,305 ****
>          only for diagnostic messages -- CVS no longer forks to run diff3. */
>       diffout = cvs_temp_name();
>       call_diff_setup ("diff3");
> !     call_diff_arg ("-E");
> !     call_diff_arg ("-am");
>   
>       call_diff_arg ("-L");
>       call_diff_arg (workfile);
> --- 302,308 ----
>          only for diagnostic messages -- CVS no longer forks to run diff3. */
>       diffout = cvs_temp_name();
>       call_diff_setup ("diff3");
> !     call_diff_arg ("-ATam");
>   
>       call_diff_arg ("-L");
>       call_diff_arg (workfile);

I used to make this change too (well, the s/-E/-A/ part; the -T
is orthogonal), but recently discovered a drawback -- for me,
it's a showstopper; I've had to revert the change.

Suppose you make a local change to a third-party package (I use
the vendor branch, but I strongly doubt that's relevent).  You
submit your change, and it's incorporated without modification
into the canonical source.  When you merge after importing the
new version, CVS decides that what looked at first like a
conflict, really isn't, because the "conflicting" change is
identical in both child versions.  CVS just accepts the change,
and prints this message:
    ${file} already contains the differences between ${rev1} and ${rev2}

The problem is that the s/-E/-A/ patch breaks this detection, and
instead of a nice message, you get spurious merge conflicts.

I think the problem is in diff3.  -A does two things:
 1. makes diff3 dumber about identifying conflicts (suppresses
    the intelligence that would have suppressed the conflict in
    the above case)
 2. once a conflict has been identified, displays its ancestor
    version as well as the two child versions

Of course, (2) is what we're after, but diff3 provides no way to
get that without also getting (1).

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
When I came back around from the dark side, there in front of me would
be the landing area where the crew was, and the Earth, all in the view
of my window. I couldn't help but think that there in front of me was
all of humanity, except me.
        - Michael Collins, Apollo 11 Command Module Pilot





reply via email to

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