Howdy DiffMerge!
Long time listener, first time caller. Great product.
I'm currently attempting to diff two large codebases and would like to exclude/ignore ALL comments (Java, XML, HTML). This includes multi-line comments.
I have the following entries all "unchecked":
Tools -> Options -> Rulesets -> (File-type-of-choice) -> Edit... -> Content Handling -> (Appropriate "Comment" entry) -> Edit... -> "Classify Differences As Important"
Can't seem to get multi-line comments ignored. Advice would be most appreciated!
Thanks,
Joel
Pertinent info:
Ubuntu Linux 9.04 64-bit
DiffMerge Version: 3.3.0 (1001)
Multi-line comments
Moderator: SourceGear
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Re: Multi-line comments
Do single line comments get ignored properly?
You might check in the Edit Context dialog and make sure that
you have the start and end patterns set and that "Ends at EOL"
is turned off.
jeff
You might check in the Edit Context dialog and make sure that
you have the start and end patterns set and that "Ends at EOL"
is turned off.
jeff
Re: Multi-line comments
Yep, the EOL checkbox is unchecked as well. Still not ignoring multiline comments. Finding multiline comments in files is actually quite complicated ( http://ostermiller.org/findcomment.html ). Is there a spot where I can enter in a full regular expression for DiffMerge to ignore? If so, what regular expression syntax does DiffMerge use?
Would attaching sample files be useful?
Would attaching sample files be useful?
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Re: Multi-line comments
We had to reload the forum db from a backup and lost a few messages
on this thread.
The last post before the loss asked about multi-line patterns
in the lines-to-omit feature. Yes, the lines-to-omit only does one-line pattern
matching with the regex. (You can optionally ignore n lines following it for
something like page/column headers in a report, but that's different.)
If you were comparing 2 large folders of files and wanted to ignore the
$Revision$ lines, I'd use the lines-to-omit feature. It'll still show the other
comment changes as differences.
I think you said that you just had 2 large files and wanted to scan them
while ignoring all comments. In this case, I'd try to get the more complete
comment syntax regex working as described in the link you referenced.
Then turn on the hide-unimportant changes. If all goes well, the summary
counts at the bottom of the screen should be just the code changes.
If you had other questions that I haven't addressed, please repost them.
thanks
jeff
on this thread.
The last post before the loss asked about multi-line patterns
in the lines-to-omit feature. Yes, the lines-to-omit only does one-line pattern
matching with the regex. (You can optionally ignore n lines following it for
something like page/column headers in a report, but that's different.)
If you were comparing 2 large folders of files and wanted to ignore the
$Revision$ lines, I'd use the lines-to-omit feature. It'll still show the other
comment changes as differences.
I think you said that you just had 2 large files and wanted to scan them
while ignoring all comments. In this case, I'd try to get the more complete
comment syntax regex working as described in the link you referenced.
Then turn on the hide-unimportant changes. If all goes well, the summary
counts at the bottom of the screen should be just the code changes.
If you had other questions that I haven't addressed, please repost them.
thanks
jeff
-
- Posts: 1
- Joined: Thu Oct 08, 2009 2:53 am
Re: Multi-line comments
Hi,
I tried the option to mark comments in c source files as important/unimportant. This is very useful, when comparing single files.
But is there a way to use this option to ignore comments when comparing directories?
The problem for me is, that only files with differences in the source code (not the comments) should be displayed as different. I would like to have files with differences in the comments, but not in the code, to be displayed as equivalent, like it is done for differences in e.g. the number of blanks.
Example:
2 Files containing these code should be treated as equivalent.
The omit lines option is not well suited since a comment may appear at the end of a source code line.
I tried the option to mark comments in c source files as important/unimportant. This is very useful, when comparing single files.
But is there a way to use this option to ignore comments when comparing directories?
The problem for me is, that only files with differences in the source code (not the comments) should be displayed as different. I would like to have files with differences in the comments, but not in the code, to be displayed as equivalent, like it is done for differences in e.g. the number of blanks.
Example:
Code: Select all
// comment
int test(int i)
{
return (i + 1) // increment
}
Code: Select all
// another comment
int test(int i)
{
return (i + 1) // increment value
}
The omit lines option is not well suited since a comment may appear at the end of a source code line.
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Re: Multi-line comments
Currently, no. Sorry.
It'd be nice for folder windows to be able to make use of the Content Handling
settings (important/unimportant for literals vs comments), but it currently doesn't.
I didn't do it because it'd make the folder window even more sluggish than it is now.
j
It'd be nice for folder windows to be able to make use of the Content Handling
settings (important/unimportant for literals vs comments), but it currently doesn't.
I didn't do it because it'd make the folder window even more sluggish than it is now.
j