Page 1 of 1

Filters - a modest suggestion

Posted: Fri Jul 02, 2010 7:24 am
by timgclark
May I humbly suggest that (a) the syntax and resulting semantics for filtering is not very good, (b) why not use proper regular expressions - they are very powerful and easy to implement with an existing library (especially if the regular expression engine has non-greedy wildcards), or (c) use ant-like file name expressions.

What brought this to mind, was that it seems to be impossible to exclude all directories with name ".svn".

In Ant syntax that would be described by "**/.svn".
In Java regex it would be something like "\.\\(.*?)\\\.svn(.*?)\\([^\\]+)".

Of course I may just not understand your filter syntax -- if so please correct my mistake :)
The explanation given for the filter syntax is somewhat unclear. It says the following:

"Prefix filters with ':' for full path matching."

I can't figure out what that means, particularly if I look at the built-in filter called "Exclude source control" which is this:

*.bak,*.scc,*.taf,:*_svn*:*.svn*,:*\cvs\*

What is ":*.svn*" supposed to do? It does NOT for instance exclude relative paths that are displayed like these:

.\.svn\
.\codesourcery\.svn\

Regards, Tim

Re: Filters - a modest suggestion

Posted: Fri Jul 02, 2010 11:24 am
by psguru
May I humbly suggest that (a) the syntax and resulting semantics for filtering is not very good, (b) why not use proper regular expressions - they are very powerful and easy to implement with an existing library (especially if the regular expression engine has non-greedy wildcards), or (c) use ant-like file name expressions.
We specifically avoid using regular expressions in this instance for faster parsing.
"Prefix filters with ':' for full path matching."
By default, only names are matched against the filter. Filters prefixed with ":" will match against full paths of files/directories.
What is ":*.svn*" supposed to do? It does NOT for instance exclude relative paths that are displayed like these:

.\.svn\
.\codesourcery\.svn\
The filter should indeed behave this way. The problem lies in your filter list, which is missing a comma:

Code: Select all

*.bak,*.scc,*.taf,:*_svn*:*.svn*,:*\cvs\* 
should be

Code: Select all

*.bak,*.scc,*.taf,:*_svn*,:*.svn*,:*\cvs\* 
The missing comma was a minor ExamDiff Pro bug that was fixed a few months ago. Download the latest version of ExamDiff Pro and resetting the filters to default will resolve this issue, or you can simply insert the missing comma.

Re: Filters - a modest suggestion

Posted: Mon Jul 05, 2010 1:47 am
by timgclark
Please see the attached screenshots -- it looks as if the desired exclusion patterns are NOT working.
Am I missing something?

The version I am using is Build 5.0.1.2

Re: Filters - a modest suggestion

Posted: Mon Jul 05, 2010 6:28 am
by psguru
Your filter looks fine. Are you using the View | Use Comparison Filters menu command to actually enable your filter?

Re: Filters - a modest suggestion

Posted: Mon Jul 05, 2010 8:10 am
by timgclark
Aah --- I was getting confused between the View filter and the Comparison filter.

Duh!!

Thanks for your help.