Forums / Upgrading from 1.3.x to 1.3.9 / Using WinMerge - Topic Revisited

Using WinMerge - Topic Revisited

Locked

Started by scriptjunkie on 26 Nov 2010, 7:46 AM · Views: 7,848

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
26 Nov 2010, 7:46 AM
#1
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Using WinMerge - Topic Revisited

Hi There,

I'm using the most recent version of WinMerge (2.12.4) and have read the previous sticky on Using WinMerge and have applied a comments filter and turned off viewing for identical files.

In spite of this, the comparison is still returning almost 1800 files. I am comparing the original V138a to the back up download from my store - also V138a.

A quick glance at a few of the files reveals that the software is reading white space and carriage return differences as actual "differences".

My questions are related to the settings in WinMerge. In order to reduce the number of files returned as "different" so that I may better identify my changed files,

  1. Should I set it to ignore white space, and if so, which of my two white space ignore options is the better choice? (Ignore Change or Ignore All White Space)

  2. Should I set it to ignore blank lines?

  3. Should I set it to ignore carriage return differences?

TIA for your help :)

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

26 Nov 2010, 8:16 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Using WinMerge - Topic Revisited

Set them all if your current set of file are functional
Just remember this if you are trouble shooting a blank page issue where you might need the ignore blank lines turned off

Zen-Venom Get Bitten

26 Nov 2010, 8:17 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Using WinMerge - Topic Revisited

Your FTP program has probably mangled the line-endings, in which case "Ignore carriage return differences" would be appropriate.
The others are probably best to leave as-is IMO.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Nov 2010, 8:20 AM
#4
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Awesome :) Thanks Kobra and DrByte for the fast responses :)

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

27 Nov 2010, 12:02 AM
#5
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Hi There :)

My questions this time around are about file comparison & merging as part of the upgrade process, however I'm posting them here because the questions are also about correctly interpreting what I see in WinMerge in order to carry out that process. I hope that's ok.

Here's where I'm at and what I've done so far:

I'm using WinMerge 2.12.4 to compare the 138a fileset with the 138a files from my live store. I'll refer to them as Fileset and Live, respectively, throughout this post.

As stated in my initial post, the first comparison returned almost 1800 files after turning off "view identical" in the view menu and applying a filter for comments. So I ran it again after turning off "compare white space", "compare blank lines", and "compare carriage return differences". This action returned just under 800 compared files.

My next step was to hide all image files by highlighting them, right clicking, and selecting "hide items". This action brought me down to a less daunting, but still hefty 305 files.

Of these remaining files, about 3/4 of them have a comparison result of "right side only" (Live) and about a quarter of them have a comparison result of "text files are different". Only two of them have a result of "left side only" (Fileset) and these are the two config files named "dist-config" that came with the fileset and were moved and renamed to "config" upon installation.

Ok, on to my questions.

========================================

Interpreting Results in WinMerge

  1. Does the "right side only", (Live) mean that these are new files that were not in the original fileset because they were created when mods were installed?

  2. Does "text files are different" mean that the file exists in both Live and the Fileset, but that it has been altered by Mods and/or my customizations & design changes?

(The vast majority of these are in MY CUSTOM TEMPLATE, but a handful are core code files (i.e. invoice customization, email customization, etc - all common core code customizations - nothing fancy or outrageous).

Next Steps Questions

I know my next step, according to the tutorial, is to run WinMerge to compare 138a Live with the 139h fileset, (I'll refer to them as Live and **New Fileset, **respectively), and make the appropriate file edits.

  1. Am I correct in thinking that when I run this comparison, that pretty much all of the files will be different?

  2. And so in order to more easily identify my changed files so I can edit their **New Fileset **counterparts, I should make a list of all files returned with a comparison result of "text files are different"?

  3. Because the files returned as "text files are different" are comprised of both override and non-override files, I have two questions:

    a) Of those that are core code customizations, am I correct that each of their New Fileset counterparts must be edited with the changes that were made to them?

    b) Of those that are part of the override system (found in MY CUSTOM TEMPLATE), I can leave those alone unless they appear on the list of changed files in the 139h changelog?

  4. Regarding files returned as "right side only" (Live) - if these are indeed new files added by Mods, I shouldn't need to do anything with them, correct? Wouldn't they be handled the same way override files not appearing on the changelog list are handled? i.e. do nothing in terms of file editing in New Fileset?

  5. In order to better understand why I'm using WinMerge twice over three sets of ZC files, can you tell me if I'm understanding correctly based on the statements below?

The primary reason for using WinMerge to compare Live with Fileset in step 1 was to identify which files I have changed through customization and Mod addons so I would know what files in New Fileset to edit later?

And....

The primary reason for using WinMerge to compare Live and New Fileset in this step is to easily identify the changes & customizations in **Live **and then use them to edit New Fileset in order to carry those changes over in the upgrade, thus keeping my settings, designs, customizations, etc?

Ok, I think that's all the questions I have on the subject. TIA for the help :)

==========================================================================

Append: Oops, I do have one more question.

DrByte, you responded to my initial post that you would not have WinMerge ignore white space or blank lines. Can you please help me understand the role white space and blank lines play in terms of accurate file comparison? i.e. do they serve a purpose for this particular process (comparing files for zc upgrade) that could be undermined?

Do I risk missing an important file edit if I apply white pace and blank line "filters"?

Thanks much!

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

27 Nov 2010, 12:25 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Using WinMerge - Topic Revisited

If you ignore whitespace within lines then you might miss cases where spaces or tabs were intentionally added for some reason.
If you ignore blank lines then you might miss a case where a line was added intentionally. This may be a non-issue in most cases, but it still allows a true comparison. If nothing else has changed in the file, then of course you can just ignore that one from the results.

Keep in mind that THE REASON for using WinMerge to compare the OLD ORIGINAL vs CURRENT site is JUST to quickly identify all the changes that you need to rebuild into your new site. That's essentially all you're doing: redoing your site in the new version, using all the changes you made previously as a reference for what to customize in the new one. If you wish to skip certain changes when redoing the site in the new version, that's entirely up to you. The WinMerge comparison is just a very handy tool for identifying the things that you need to do.

The guide suggests comparing the current site with the new files simply as a means of allowing you to easily copy from old to new as needed. Since generally most files will be largely the same, simply copying certain sections of code from the old customized files to the new versions of those files is mostly all you'll be doing, except in cases where certain files have had major updates in the new version.

And, yes, "right side only" files are files that don't exist on the left side, and thus were likely added in that set of files.
And likewise "left side only" files are files that don't exist on the right side, and thus were likely deleted in that set of files.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Nov 2010, 12:37 AM
#7
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Wow, thanks for the fast response doc!

I understand now about white space and blank lines and the uncommon but still possible inherent risk to skipping/ignoring them.

Keep in mind that THE REASON for using WinMerge to compare the OLD ORIGINAL vs CURRENT site is JUST to quickly identify all the changes that you need to rebuild into your new site.

I think I came to that realization while typing out my last post... it all started to come together in my head as I typed out my questions.

I guess for me the issue is that if I don't ignore white space and blank lines, those files return with a comparison result of "text files are different". This requires me to look at them one at a time to see how they are different and sort through which ones have code difference vs. just space difference.

Not a real big deal except that the difference in the number of files to look at when the filter is off vs. on is several hundred files. That takes the ease and quickness out of the process.

I was just trying to eliminate some of the hassle. But...it is better to be safe than sorry later.

Before I go down that road however, do you have any suggestions for an easier way of isolating the white space and blank line files from the files that actually have code change?

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

27 Nov 2010, 12:42 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Using WinMerge - Topic Revisited

Hmmmm ... I just look at them anyway. It only takes a second and then I "know".

Granted, I usually use a 3-way comparison tool instead, which allows me to not only view the changes, but also immediately copy the parts I want to preserve ... right while I'm looking at it. Then I'm done with that file, and move on.

In MANY cases when looking at the files I just ignore white space and blank lines, cuz I don't wanna copy anything onto the new files that I don't really need ... cuz touching as few files as possible makes the next upgrade faster yet again.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Nov 2010, 1:41 AM
#9
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Yeah, you're right. I think the number of files to do that with overwhelmed me because it was late and I was tired. Realistically, I probably would only save an hour or so of work. Put in those terms, not worth the risk of missing something.

Thanks for your help!

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

15 Apr 2011, 8:48 AM
#10
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Using WinMerge - Topic Revisited

Ok so how do you get winmerge to ignore differences in the comments,
when i go into winmerge -> compare -> options
no matter what the comments option is set to i get the same result.

or is this something i am supposed to add in to winmerge

edit------------------------
yeesh I search for hours, post for help, then find it a minute later

http://www.zen-cart.com/forum/showthread.php?t=7330

Webzings Design
Semi retired from Web Design

15 Apr 2011, 8:56 AM
#11
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: Using WinMerge - Topic Revisited

Ok not so easy

winmerge 2.12.4.0

is that block supposed to be entered line by line? and where is the ignore option

Webzings Design
Semi retired from Web Design

15 Apr 2011, 4:02 PM
#12
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

nigelt74:

Ok so how do you get winmerge to ignore differences in the comments, when i go into winmerge -> compare -> options no matter what the comments option is set to i get the same result. or is this something i am supposed to add in to winmerge

edit------------------------
yeesh I search for hours, post for help, then find it a minute later

http://www.zen-cart.com/forum/showthread.php?t=7330

Isn't that always the way it goes? :smile:

*Go that extra mile, you never know what's at the end of the road

* Empowerment Sanctuary

17 Dec 2011, 12:18 PM
#13
mlplus avatar

mlplus

New Zenner

Join Date:
Dec 2011
Posts:
2
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Can anyone help me with this? Winmerge doesn’t want to show a match.

I am trying to find all the matching files in these two directories(and sub directories). On the left it’s a folder with many files; on the right it’s a folder that contains many sub folders that contain files. There are many file matches but they wont show as matches.. HELP! Can winmerge do this? If not can anyone tell me what software can? Thanks in advance.

Right - H:\media\music ( note there many sub directories in this folder that contain matching files in the left folder)

Left - Z:\music

Thanks again

17 Dec 2011, 3:02 PM
#14
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Using WinMerge - Topic Revisited

Select the two folder for comparing and click OK.

The you should get a list of compared files. In the menu bar you can now select what you want to see. (see attachment)

17 Dec 2011, 4:51 PM
#15
mlplus avatar

mlplus

New Zenner

Join Date:
Dec 2011
Posts:
2
Plugin Contributions:
0

Re: Using WinMerge - Topic Revisited

Design 75, Thanks so much for the quick reply

I have show different and show identical checked and I still don’t getting what I looking for. I think the problem is that the files on the right side reside in sub folders while they don’t on the left side, so technically they are not “identical”. For example I have the file test.doc in: Right - H:\media\music\temp\test.doc and the same file in Left - Z:\music\test.doc.

They are the identical files but winmerge does not show them as such because on one side they are in sub folders while not on the other.

Any thoughts on how can find matches with my file structure using winmerge or another program?

Thanks again.

Marty

17 Dec 2011, 6:41 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Using WinMerge - Topic Revisited

Indeed WinMerge expects the same folder structure. It compares left-and-right exactly. If you've relocated files into other folders on the right side, but not on the left side, then it will fail the compare, because it's not the same.

I'm not aware of any automated tools that will do what you're asking, because that's no longer a direct compare-left-with-right concept.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.