Bug 31196 - [compare with] need action "Compare With Local File/Folder"
Summary: [compare with] need action "Compare With Local File/Folder"
Status: RESOLVED DUPLICATE of bug 21817
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-07 03:57 EST by Gunnar Wagenknecht CLA
Modified: 2003-02-10 08:44 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2003-02-07 03:57:58 EST
I'd like to compare two Java source directories ind two different projects 
located in the same workspace. To perform this task, I select directory A and B 
and "Compare With -> Each Other".

The result is a little bit confusing and so not correct.

1. Files are compared using their timestamp and not using there contents. Thus, 
Java source files are shown as "changed" although they have no difference.

2. The selection order is not considered. It is always assumed that the first 
directory that comes first in the "Package Explorer" view is the base directory 
and the second directory is the target directory. 

3. Added/Removed resources (files/directories) are not handled. I couldn't 
found a way to copy resources that exist in "B" into "A" and to delete 
resources in "A" that don't exist in "B".

Background:

The source project is located in CVS and the target in our local repository 
(ClearCase). It is currently not possible to place on project into two 
different repositories. But I need a way to easy merge changed done in the 
source projects CVS into the target project located in ClearCase. A good way is 
the "Compare With -> Each Other" action, because its comparer also uses the 
auto-checkout option.
Comment 1 Kevin McGuire CLA 2003-02-07 11:06:51 EST
Compare With->Each Other is provided by the Compare component, so moving bug.

Wrt. #1 though, when you open the Compare editor you get a toolbar button (in 
the top toolbar, not the editor's) with hover help "Ignore Whitespaces where 
Applicable".  This should give you what you want.

I will leave Compare to comment on #2 and #3.
Comment 2 Gunnar Wagenknecht CLA 2003-02-07 11:13:02 EST
I know of this option but it is useless. Whether it is active or not the file 
list always contains elements with different timestamps although their 
filecontent is equal.


Also ignoring whitespace is not enough if whitespaces only consist of tabs and 
spaces. It should also be possible to ignore different line seperators between 
Unix and Windows. ClearCase for example handles them automatically. It converts 
line seperators on checkin and checkout.
Comment 3 Andre Weinand CLA 2003-02-07 11:33:06 EST
- "Compare with Each Other" doesn't look at timestamps. It just considers contents.
  So if the file is listed in the resource view of "Compare With Each other" it must have
  differences.
- If files have different line separators but otherwise have the same content,
   they are considered "different" (we have a feature request for this)
- ignore whitespace is handled in the structure compare viewer (right pane) and
  the content compare viewer (bottom pane). In case of Java files "ignore whitespace"
  even eliminates formatting differences (across multiple lines).
- SWT doesn't provide "selection order".
   SWT returns the native order (whatever that is).
Comment 4 Gunnar Wagenknecht CLA 2003-02-07 11:44:49 EST
Do you know the id of the feature request? I didn't found (or find?) it doing a 
query before filling this report.

According to your comments I suggest changing this bug into a feature request 
for adding an "Compare With -> Local Folder/File" action. Is it ok?
Comment 5 Andre Weinand CLA 2003-02-07 12:39:33 EST
The bug is: #30883:
Compare viewer shows false positives with "ignore whitespace" turned on

Yes, please go ahead and rename this bug and change severity into "enhancement".
Thanks.
Comment 6 Gunnar Wagenknecht CLA 2003-02-07 12:53:01 EST
The propose of this feature request is to add an action into the "Compare With" 
group.

It should enabled the user to compare a file or folder (container) with a file 
or folder located in the local filesystem (or workspace). 

The "Compare With -> Each Other" is not suitable for this because it is not 
possible to set the difference between source and target folder, although it 
might the easily enhanced to provide the new action.

The action must decide between source and target folder. As a result is must be 
possible to merge the content of the source folder into the target folder (eg. 
delete files/folders in the target folder that doesn't exists in the source 
folder and copy new/changed files/folder from the source folder into the target 
folder).
Comment 7 Andre Weinand CLA 2003-02-10 08:44:04 EST
I'm going to make this one a duplicate of  #21817, which is alread planned for 2.2.

However, did you try to use a "linked" folder?
Just create a folder in an existing (or new) project and press the "Advanced >" button. 
Here you can specify an external folder to "link to". With this setup you can compare 
workspace files to external files without having to copy them into the workspace first.


*** This bug has been marked as a duplicate of 21817 ***