comparePlus icon indicating copy to clipboard operation
comparePlus copied to clipboard

Option to ignore multiple lines when comparing

Open johnanson opened this issue 6 years ago • 8 comments

Thank you very much for the Notepad++ Compare plugin. For me it's the most useful Notepad++ plugin.

I would like an option to specify lines that are skipped when navigating through the differences between 2 files with the keyboard shortcuts (Alt-PageUp/Down)

Why: I use Notepad++ to compare FortiGate configuration export files. These router export files include several encrypted secrets which change every time the configuration is exported, and are "noise" when looking to see what lines have changed.

If you are willing to implement this, it could be done by allowing a regular expression to specify lines that should be excluded from highlighting as different and/or landing on when navigating. eg in my use case above, I'd like to exclude lines matching "^\s*set password ENC"

Thanks, John

johnanson avatar May 20 '18 23:05 johnanson

Hello John,

Pavel Nedev (CP developer) is currently away and should be back next week. I'm sure you'll get a reply as soon as he can.

Best regards.

Yaron10 avatar May 20 '18 23:05 Yaron10

Hello @johnanson ,

That sounds like a useful feature. Would you like just to exclude the regular expression matches from navigation commands or from the whole compare process (this includes the highlighting as well)?

Greetings @Yaron10 ,

Thank you.

BR

pnedev avatar May 28 '18 15:05 pnedev

:+1:

Yaron10 avatar May 28 '18 19:05 Yaron10

Hi Pavel

  1. In my use case, I'm not interested in any highlighting for the encrypted strings that change each time I export the configuration.
  2. It would be helpful if there was an indicator to remind users when a filter for highlighting/navigating differences is active.
  3. I've noticed that some of the encrypted keys are multi-line (see below).

These also change with every export, and are noise when comparing files.

Having an option to allow the regular expression to include newline characters could allow for this. eg for the one and two line encrypted keys below, a regular expression (with ". matches newline ticked) like this finds both cases in Notepad++ : ^\sset password ENC.?\n|^\sset private-key.?END ENCRYPTED PRIVATE KEY.*?\n

Thanks again for the great plugin.

Regards, John

One line key: set password ENC WTLIMzeZ/nHGb4iWfl7A1fySSQExxxxxxxxxxxxxxcgEJ4Ra1mM8Cx2kVaQyLEfmfdfNRfNT8DR51eh+Yp2Pr4jEV/QA5yqeAPmQtOljIDQnROCKWM/+5HhbCWU/ivC7KX1hPBloj/EzbWuBWIVyq3JdUlptaK+2y0X/djxy/nL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XFSTdGKsULoIRUkgWck0ZnRkuicyx24YZl5R2IR bF2uP8ywBpT1i1oxxxxxxxxxxa94x35SbElmPZA78h47Vx/91RebCmQ7iEjJotxc gyopuzKAGU/SkWBxxxxxxxxxxta8gs9UGJD3POkHiyXjfPbOhxWltnDnu+/GYXXe gtZLC1EngPRYG5cxxxxxxxxxxsnblmOF14bcztG780kvQWrcFE1ru4S44c4Jvgv4 smqc23L7YcAI+AGxxxxxxxxxx3h1pWxNEZCvUhcRJ+4SkEZLwQi/HKM1PMfuhrwh YN6d34iBzOP3pqxxxxxxxxxxxkzMnaB0OglBNTvS2sPAHBgEi/Va02d0CWnFBiWt i0bnT5GwA6SChuhxxxxxxxxxxzXBEjtbZAkoQTuvlrgcOnllKiQOi1zdpPK/XVbe q/kTlGmh6Nf9KA/xxxxxxxxxxZAGxmwpmiP7nXz/CApmrE0r2CB3zNsSdPXSHWfR j2IWLvmntlOj4yAxxxxxxxxxxrwxRjz/3BSNkdtLxF29jTIKsEfhdx6KafAVaJcK 28/3sBGHyiMRrK9xxxxxxxxxxArLkLP8e5bQvIX7cuHkCNn61XBgeBiepsrVfKC9 QA4us/jl6hl18dZxxxxxxxxxxrt84d0I1c4XHwC+gzqqIXMkWUJNCyKsZXFYmxBF uAPCItukabIM1RUxxxxxxxxxxvxR0i0R2dNxOB8aYP0vvdU5PELMOcFy8D90ZoWR 8oc= -----END ENCRYPTED PRIVATE KEY-----"

On Tue, 29 May 2018 at 03:04, Pavel Nedev [email protected] wrote:

Hello @johnanson https://github.com/johnanson ,

That sounds like a useful feature. Would you like just to exclude the regular expression matches from navigation commands or from the whole compare process (this includes the highlighting as well)?

Greetings @Yaron10 https://github.com/Yaron10 ,

Thank you.

BR

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pnedev/compare-plugin/issues/167#issuecomment-392549828, or mute the thread https://github.com/notifications/unsubscribe-auth/AXnykeXYyY9orIkEPxmbHsIMLklEf1-cks5t3BHogaJpZM4UGRHD .

johnanson avatar May 30 '18 00:05 johnanson

Hi John,

Thank you for elaborating. This is certainly very useful feature but it is hard to implement and it's going to take time. I don't think I'll be able to include it in the next plugin release. I'll see what I can do.

BR

pnedev avatar May 30 '18 06:05 pnedev

Hello Pavel . First I want to thank you for this amazing plugin and make some suggestion. I have read all above but still not sure if my suggestion is the same as johnanon's. Is it easier to force plugin to ignore some found differences by entering key-word(s) or value? For example, I have 2 similar files (1000+ strings) and most of differences are the same (they take about 70% of the whole file) and they are ok for me <Property name="Multiplier" value="1000" /> | <Property name="Multiplier" value="1" /> Its pain to find other rare differences from those above. So i'd like to have a button to ignore some compare results (ignore if string have "Multiplier" value="1000" in left and/or right field)

Thanks for reading and sorry for my English

KeerealYo avatar Aug 22 '18 14:08 KeerealYo

Hello @KeerealYo ,

Sorry for the late reply. That would be a good feature, yes. I'll consider implementing it sometime in the future but it will take time for sure. I can't promise anything. Thanks for writing.

BR

pnedev avatar Aug 27 '18 08:08 pnedev

Hello all,

In a month I will release the new ComparePlus plugin that will have advanced ignore feature which is actually a regex ignore but it is line-based. So every line is partially ignored based on the user supplied regex. I understand that it will not fully cover your use-cases but I hope it can at least be a partial match. I will keep this issue open as a reminder and in case I think of a way to easily implement a multi-line ignore.

BR

pnedev avatar Jul 17 '22 13:07 pnedev