Menu

#2712 Patch for SourceControl.flt (Version 2.11.1.6)

Future
open
nobody
5
2013-03-02
2008-10-28
No

In current version of the filter file all ignore-files are inline comments, there is some strange comment about ASP.NET developers included and all files&folders are listed one by one.

Attached version is fixed and uses more regex for putting all ignore files / Source Control directories in one line:

f: *\.(bzr|cvs|hg|svn)ignore$ ## Filter for all Source Control ignore files
d: \\(cvs|\.svn|_svn|\.bzr|\.hg)$ ## Filter for all Source Control directories

This is especially useful in elusive filters because one can just negate the Source Control directories with (?!(...)), this looks like d: (?!(\\(cvs|\.svn|_svn|\.bzr|\.hg)$)) ## Filter for all directories but Source Control

Is this a worthy patch?

Discussion

  • Simon Sobisch

    Simon Sobisch - 2008-10-28

    Source Control filter with ignoring the ignore-files and use of regex

     
  • Simon Sobisch

    Simon Sobisch - 2008-10-28

    Of course one have to use [^()] for inverting, therefore
    d: [^(\\(cvs|\.svn|_svn|\.bzr|\.hg)$)] ## Filter for all directories but Source Control

     
  • Kimmo Varis

    Kimmo Varis - 2008-11-03

    Sorry for not commenting this earlier.

    I've looked at this couple of times and I'm wondering what is the real advantage of making regexp filters harder to read?

    Yes, there is some speed advantage in having all folder names in one regexp, but I consider filter definitions as a user interface too. So I think having filter definitions easy to understand and edit is more important than the speed gain there is.

    Also the .ignore files have been commented out with purpose. You may really want to merge them too. So if user wants to ignore them, it is easy to edit the filter. But if those files are "missing" by default it may cause some confusion. But I'm not strict about this one, its one file after all...

     
  • Simon Sobisch

    Simon Sobisch - 2008-11-03

    1. Do we agree, that the comments about ASP.Net should be changed?
    2. We can take or leave ignore-files, just as you like it.
    3. Advantages:
    - little more speed (you've mentioned that before)
    - after getting a little bit into regex the suggested one is easier to read for me
    - we can show and explain a little regex to the users (I can explain the filter as an example for the help file, if you want me to)
    - the line with the directories can be copied 1:1 to exclusive filters and be negated by [^...]

    By the way:
    Can we put the negated line into all exclusive filters?

     
  • Kimmo Varis

    Kimmo Varis - 2008-11-03

    1. Yes, comments need fixing, no question about that
    2. Well, I'm sure lots of users want to see ignore files and lots of users don't want to see them so as there is no clear preference it is best to keep the situation as is. As there is no really good reason to change the situation.
    3. You have good points. Still:
    - I claim that most WinMerge users aren't experienced regular expression writers
    - so making editing harder for them isn't a good thing, experienced users can easily modify filters anyway
    - but of course learning from example is a good thing too
    - so having more complex-looking regexp with some explanation might be useful for people learning regexps and filters
    - and speed is important for WinMerge

    I'm fine adding more complex regexps, as long as there is proper comment/explanation so that people don't need to wonder what it really does. You don't want to use filters you don't understand...

    > Can we put the negated line into all exclusive filters?
    With comment and as a separate patch, yes.

     
  • Simon Sobisch

    Simon Sobisch - 2008-11-04

    So anything left I can/should do now?

     
  • Kimmo Varis

    Kimmo Varis - 2008-11-04
    • labels: 572061 --> File handling
    • milestone: --> Trunk
     
  • Kimmo Varis

    Kimmo Varis - 2008-11-04

    Can you submit a patch for the filter file with improved comments. I think it could be something like this:

    ## f: *\.bzrignore$ ## Bazaar ignore file
    ## f: *\.cvsignore$ ## CVS ignore file
    ## f: *\.hgignore$ ## Mercurial ignore file
    ## f: *\.svnignore$ ## Subversion ignore file

    ## All above rules combined to one rule
    ## You can use above rules or this single rule - they are equal in function.
    ## However one rule can be a slightly faster.
    f: *\.(bzr|cvs|hg|svn)ignore$ ## Filter for all Source Control ignore files
    f: \.(vs[sp])?scc$ ## Visual SourceSafe files

    ## d: \\\.svn$ ## Subversion working copy
    ## d: \\_svn$ ## Subversion working copy ASP.NET Hack
    ## d: \\cvs$ ## CVS control directory
    ## d: \\\.bzr$ ## Bazaar branch
    ## d: \\\.hg$ ## Mercurial repository

    ## All above rules combined to one rule
    ## You can use above rules or this single rule - they are equal in function.
    ## However one rule can be a slightly faster.
    d: \\(cvs|\.svn|_svn|\.bzr|\.hg)$ ## Filter for all Source Control directories

    Or? Nothing prevents adding more explanation into filter files, comment lines are simply ignored by WinMerge...

     
  • Christian List

    Christian List - 2013-03-02
    • milestone: Trunk --> Future
     

Log in to post a comment.