Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Ability to ignore blank line changes #82

Closed
DigiLive opened this issue Dec 3, 2020 · 13 comments · Fixed by #86
Closed

TODO: Ability to ignore blank line changes #82

DigiLive opened this issue Dec 3, 2020 · 13 comments · Fixed by #86

Comments

@DigiLive
Copy link
Collaborator

DigiLive commented Dec 3, 2020

Can you elaborate on the ability to ignore blank line changes?

@JBlond
Copy link
Owner

JBlond commented Dec 3, 2020

That is a good idea. I did spent any time on that yet.

@JBlond
Copy link
Owner

JBlond commented Dec 3, 2020

I guess it should no be too hard to implement in function linesAreDifferent. White space ignore is already there.
Maybe a

<?php
preg_replace('/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/', '$1', $input);

or better use

/(?m)(.*)(\R?\n\1)+$/

@DigiLive
Copy link
Collaborator Author

DigiLive commented Dec 3, 2020

I don't know... I actually wanted you to clarify what the todo item means. 😅

@JBlond
Copy link
Owner

JBlond commented Dec 3, 2020

it means, that in a comparison blank lines should be ignored (as an option).

It is in the readme file before I forked the repo.

@DigiLive
Copy link
Collaborator Author

DigiLive commented Dec 3, 2020

I'm sorry, but I still don't follow 😅...
If a line is blank at both versions, they're just the same and unmarked.
(Version1, line 15 vs Version2, line 14)
If a line is blank at only 1 version, it shouldn't be ignored because the line at the other version isn't blank.
(Version1, line 8 and Version2, line 14)

Please provide an example so I can clearly understand what it means.

@JBlond
Copy link
Owner

JBlond commented Dec 3, 2020

Don't compare blank lines at all and or example

file a) blank lines 10 - 12. file b) blank lines 10 - 27. With the option set there is no difference.

For example when I compare CSV files I don't care about some blank lines. The content it what counts. Blank lines are ignored at import into any system.

@DigiLive
Copy link
Collaborator Author

DigiLive commented Dec 3, 2020

Nope. Sorry, I just don't get it.
You can email me an excel file which mimics the output of the SideBySide renderer with such option enabled.

@JBlond
Copy link
Owner

JBlond commented Dec 4, 2020

I created a gist. https://gist.github.com/JBlond/1632bc8b134a3dbb9545bbbdbcfe7021
With the option set the diff should show no differences.

@DigiLive DigiLive self-assigned this Dec 7, 2020
@DigiLive
Copy link
Collaborator Author

DigiLive commented Dec 7, 2020

Do you prefer to introduce a new tag, e.g. ignored or do you really want to tag the ignored 'differences' as being equal?

@JBlond
Copy link
Owner

JBlond commented Dec 7, 2020

Choose as you like. Add a new tag is fine. It might be more clear.

@DigiLive
Copy link
Collaborator Author

DigiLive commented Dec 8, 2020

I think I'm getting somewhere.
Will make a PR soon to be thoroughly tested.

@DigiLive DigiLive linked a pull request Dec 10, 2020 that will close this issue
@DigiLive
Copy link
Collaborator Author

Please test PR #86

@JBlond
Copy link
Owner

JBlond commented Dec 23, 2020

I'll get to that after Christmas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants