Skip to content

Regex excludes cause existing patterns to behave differently #6245

Closed

Description

@ckamm

From @sagamusix #5017

for example my pattern */.svn/pristine/ no longer seems to work

Summary from investigation:

The client used fnmatch with FNM_PATHNAME on unix and PathMatchSpec on Windows. These had different behavior when expanding * patterns: fnmatch never expands it to /, while that is allowed on windows. That means */foo/bar would match a/b/foo/bar on windows, but not on other oses.

The new regex exclude matching code implements the fnmatch behavior on all platforms thereby changing the meaning of existing patterns on windows.

Activity

  1. added this to the 2.5.0 milestone on Dec 14, 2017
  2. self-assigned this
    on Dec 14, 2017
  3. changed the title [-]Regex includes cause existing patterns to behave differently[/-] [+]Regex excludes cause existing patterns to behave differently[/+] on Dec 14, 2017
  4. ckamm commented on Dec 14, 2017

    @ckamm
    ContributorAuthor

    @sagamusix So it's now syncing some folder foo/.svn/pristine and its contents?

  5. sagamusix commented on Dec 14, 2017

    @sagamusix

    Exactly, and previously these files were ignored as intended.

  6. ckamm commented on Dec 15, 2017

    @ckamm
    ContributorAuthor

    @sagamusix It works for me. The pattern gets translated to ^[^/]*/\.svn/pristine)(?:$|/). Can you let me know what path exactly was excluded before and isn't anymore?

    Idea I have: You're on windows, and we're seeing a previous inconsistency between windows and linux. On linux we used FNM_PATHNAME so a * never matched a /. Maybe on windows a * (incorrectly!) did match a slash?

    Since we no longer rely on fnmatch and PathMatchSpec the behavior will now be consistent - and I used the fnmatch behavior as the baseline.

  7. sagamusix commented on Dec 15, 2017

    @sagamusix

    Two paths were matched before I realized and aborted the sync; one was Uni\powerwall-trunk\.svn\pristine and the other one was similar in structure. It seems like if I move the folder one level up, it works as intended, which coincides with your idea, I think.

  8. sagamusix commented on Dec 15, 2017

    @sagamusix

    I have changed the pattern to just .svn/pristine/ (including all other patterns in my list from other issue that were structured similarly) and it seems like the initial discovery is much, much slower now - it's now running for almost 2 hours for a ~35 GB folder that previously took a few minutes. In fact, it's still discovering folders so I cannot see yet if it helps fixing the problem. I can still occasionally see folders that are not supposed to be synced in the progress indication, though, so I'm not sure if this helped at all.

  9. ckamm commented on Dec 15, 2017

    @ckamm
    ContributorAuthor

    @sagamusix changing too .svn/pristine/ still wouldn't trigger the right behavior. See #5275 for discussion of the unclear behavior.

  10. sagamusix commented on Dec 15, 2017

    @sagamusix

    So do I understand correctly that what I wanted previously only worked by chance?

  11. ckamm commented on Dec 15, 2017

    @ckamm
    ContributorAuthor

    Yes, unfortunately. But I don't think it's acceptable to break patterns windows users had added. I think we'll need to put in extra work to make sure that migrates nicely.

    And that performance issue you're seeing also definitely needs to be investigated.

  12. ckamm commented on Dec 19, 2017

    @ckamm
    ContributorAuthor

    I'm looking at allowing * to match .* in the regex: it complicates the bname-as-activation optimization though since foo/bar*daa could very well be activated by a bname xyzdaa. It may be ok to be just mostly correct here.

  13. ckamm commented on Jan 9, 2018

    @ckamm
    ContributorAuthor

    @sagamusix I've adjusted the regex matching on windows to be backwards compatible. Could you check out the new 2.5 nightly when it becomes available?

  14. added
    ReadyToTest
    on Jan 9, 2018
  15. sagamusix commented on Jan 9, 2018

    @sagamusix

    Judging from the timestamps, I guess the current nightly build doesn't have the fix yet, right?

  16. sagamusix commented on Jan 10, 2018

    @sagamusix

    The patterns seem to work as intended again, although initial discovery still seems to have slowed down considerably. The discovery took almost exactly 5 hours, which used to be a matter of minutes. To make things worse, it ended with an "operation cancelled" error from the server. :)

  17. ckamm commented on Jan 11, 2018

    @ckamm
    ContributorAuthor

    @sagamusix Ouch, that's horrible. Let's move back to the optimization task #5017. Thanks for testing.

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

Metadata

Metadata

Assignees

Labels

ReadyToTestWindowssev1-criticaltype:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions