-
Notifications
You must be signed in to change notification settings - Fork 85
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
CompilationDir filter doesn't support string parameters with multiple compilation dir appearance #188
Comments
masterzen
changed the title
CompilationDir filter doesn't support string parameters with multiple compilation dir
CompilationDir filter doesn't support string parameters with multiple compilation dir appearance
Jun 5, 2018
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
Jun 6, 2018
…ltiple values There were two cases where CompilationDir wasn't filtering out changes: * if the parameter value is an arbitrary data structure (ie hash, array or mix of both) * if the parameter value is a string containing more than one occurence of the compilation dir It turns out that both can be fixed by just replacing the compilation dirs in both the new and old values with empty strings and comparing what's left. It's probably much slower than the original string-only implementation but covers much more cases as demonstrated by github#187 and github#188.
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
Jun 6, 2018
…ltiple values There were two cases where CompilationDir wasn't filtering out changes: * if the parameter value is an arbitrary data structure (ie hash, array or mix of both) * if the parameter value is a string containing more than one occurence of the compilation dir It turns out that both can be fixed by just replacing the compilation dirs in both the new and old values with empty strings and comparing what's left. It's probably much slower than the original string-only implementation but covers much more cases as demonstrated by github#187 and github#188.
masterzen
pushed a commit
to masterzen/octocatalog-diff
that referenced
this issue
Jun 6, 2018
…ltiple values There were two cases where CompilationDir wasn't filtering out changes: * if the parameter value is an arbitrary data structure (ie hash, array or mix of both) * if the parameter value is a string containing more than one occurence of the compilation dir It turns out that both can be fixed by just replacing the compilation dirs in both the new and old values with empty strings and comparing what's left. It's probably much slower than the original string-only implementation but covers much more cases as demonstrated by github#187 and github#188.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using parameters values that are strings containing multiple references to the compilation dir (ie using
$::settings::codedir
for instance), theCompilationDir
filter is unable to detect that the parameters are strictly equivalent.For instance the following resource:
will produce the following diff:
The problem comes from the fact that the
CompilationDir
only checks for the presence of one compilation dir path in the parameter value.I think this would be more effective to replace all from and to compilation dir in the string by a placeholder and then just do string equality comparison instead of trying to split the string around the presence of the compilation dir prefix as it is now.
The text was updated successfully, but these errors were encountered: