Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#2093 Line-filtering post compare

Trunk
closed-accepted
6
2007-01-08
2006-11-09
Kimmo Varis
No

This is Proof Of Concept -patch for post compare
line-filtering using regular expressions. After this
patch nobody should claim it can't be done, or that it
is difficult etc.

It was pretty easy.

This patch adds simple container class FilterList which
holds compiled regular expressions for matching. And
implements simple Match() function to match string
against that list of regular expressions.

I used David's line filtering code as example for
actual post filtering. I match every line in difference
against list of regular expressions (in FilterList). If
any line matches, difference is marked as trivial.

That is it.

As this is proof of concept -patch is it not in any way
finished, just make it to work to show how the thing
can be done.

How to use:
- enable line filtering in filters-dialog
- give *one* regular expression to first line (as this
patch does not parse multiple lines)

When files are compared, if the expression matches any
of the lines in the difference, the difference is
marked as trivial. This made it easier to see the
effect as I didn't need to make every line to match first.

Discussion

  • Kimmo Varis

    Kimmo Varis - 2006-11-09

    Original and altered files

     
  • Kimmo Varis

    Kimmo Varis - 2006-11-10

    Logged In: YES
    user_id=631874

    Attach updated patch - this fixes memory leak and removed
    old regexp code from mainframe.

     
  • Kimmo Varis

    Kimmo Varis - 2006-11-10

    Original and altered files

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-07
    • assigned_to: nobody --> kimmov
    • summary: Line-filtering post compare (Proof Of Concept) --> Line-filtering post compare
     
  • Kimmo Varis

    Kimmo Varis - 2007-01-07

    Logged In: YES
    user_id=631874
    Originator: YES

    As nobody has commented this patch, I'll drive this into SVN in following days.

    I'm attaching a patch which is not anymore POC, but is intended for checkin. There seems to be some problems, but that should not surprise anybody as we are rewriting how the filtering works. If I can solve the problems, I'll attach a new patch. If not, I'll apply it as is and figure out the problems later.

    File Added: PostLineFiltering.zip

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-07

    Original and altered files

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-08

    Original and altered files

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-08

    Logged In: YES
    user_id=631874
    Originator: YES

    I've fixed couple of problems (able to handle just one rule from dialog, marking ignored only if one line matched etc) I found. Attaching a new patch I'll apply later today.

    I hope this fixes most of the line filtering bugs, or at least allows fixing then later.

    File Added: PostLineFiltering2.zip

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-08

    Logged In: YES
    user_id=631874
    Originator: YES

    Committed !!

    Committed to SVN trunk with couple of changes to only mark diff ignored if ALL lines in diff match. Previous patch had still some problems with that.

    Completed: At revision: 4021

    Bye bye EOL byte problems!

     
  • Kimmo Varis

    Kimmo Varis - 2007-01-08
    • status: open --> closed-accepted
     

Log in to post a comment.