On 05/03/2011 11:48 AM, James Antill wrote:
> On Tue, 2011-05-03 at 11:27 -0400, Raman Gupta wrote:
> 
>> However, for config_noreplace in my opinion we want:
>>
>>      diff pkg_file local_file
>>
>> so that the file /etc/foo.conf is *still* on the right. In this case,
>> it is the meaning of "new" where there is perhaps some confusion --
>> the way I am interpreting "new" is that the file on the right is the
>> "new" file *from this point forward*
> 
>  I don't think that's a useful meaning, but maybe I'm seeing it too much
> from a programmer POV. But say you have:
> 
>   pkgA-1 foo.conf:
> 
> """
> # This is my config file.
> # Change the name, if you want
> name = blah
> """
> 
>   pkgA-2 foo.conf:
> 
> """
> # This is my config file.
> # Change the name, if you want
> name = blah
> # Change otherthing, to snafu or null
> otherthing = snafu
> """
> 
> ...now say we install pkgA-1, and then alter it to "name = myname" then
> do an upgrade. What do we want to see in both cases? I'm pretty sure we
> _want_ to see:
> 
>  # This is my config file.
>  # Change the name, if you want
>  name = myname
> +# Change otherthing, to snafu or null
> +otherthing = snafu
> 
> ...but we can't, easily, so we have a choice between:

OK so far.

>  # This is my config file.
>  # Change the name, if you want
> -name = myname
> +name = blah
> +# Change otherthing, to snafu or null
> +otherthing = snafu
> 
> ..and:
> 
>  # This is my config file.
>  # Change the name, if you want
> -name = blah
> +name = myname
> -# Change otherthing, to snafu or null
> -otherthing = snafu
> 
> ...and I'd argue that the first is much closer to "ideal".
>  I think it's also likely to be more intuitive for the sysadmin if the
> "local file" is always in the same place.

I agree when you show a diff as you have shown above, option 1 makes
more sense (which is why I didn't change the way the "diff" option works).

However, the sysadmin's goal when running vimdiff or meld is not to
see a diff per-say, but instead to merge changes from the rpm with his
local changes. Therefore, what the sysadmin wants to see (at least I
do when I am in my sysadmin role and not my programmer role!) is the
second case, because the final conf file is always consistently on the
right side. Let's imagine what I would see graphically in meld:

I will see that on the left I have "name = blah" which in the final
file on the right is "name = myname". I can immediately see that my
change on the right is still "good" (my local change is still
consistent with the new RPM) and therefore I simply leave it as is.

I also see on the left two new lines:

# Change otherthing, to snafu or null
otherthing = snafu

and I can immediately see that these lines are new in the RPM and are
not present in my local file. So I simply click the arrow to move them
into my local file, change snafu to whatever I want directly in
vim/meld, and presto, I'm done.

Now, the second option doesn't work quite as consistently because I
need to move changes from right to left, which differs from the
config_replace case.

Now, putting on our programmer hats again, what *I* think the best
option would be is a 3-way diff with:

local file on the left
final file in the middle
pkg file on the right

which would allow us to do the complete 3-way merge.

But all sysadmin's may not be familar with 3-way merges so I'm not
sure we should go that route. What do you think about adding it as
another option?

Cheers,
Raman
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to