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

Ignore pattern beginning with "#" does not match subpaths #4680

Closed
imsodin opened this Issue Jan 17, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@imsodin
Copy link
Member

commented Jan 17, 2018

See: https://forum.syncthing.net/t/ignore-patterns-that-start-with/11173

E.g. #snapshots does not match #snapshots/foo.

@calmh calmh added the bug label Jan 17, 2018

@imsodin

This comment has been minimized.

Copy link
Member Author

commented Jan 17, 2018

While fixing this I get a test failure for the following pattern, which is supposed to result in an error during parsing:

!#include makesnosense

My new implementation only checks for lines starting with #include, in that sense the above is a correct pattern that unignores the literal string #include makesnosense. The current test only passes due to the "side-effect" that !#include makesnosense/** is parsed and the file at makesnosense/** fails to be opened. I see three options:

  1. Treat #include no different than any other string when not at the beginning (i.e. !#include makesnosense is allowed).
  2. Don't allow #include anywhere in the pattern except at the beginning.
  3. Allow #include in the pattern except when it is prefixed by our special patterns (?d)/!/... (i.e. !#include makesnosense is an error, but this#includeIsAllowed).

I favor 1, what do you think?

@calmh

This comment has been minimized.

Copy link
Member

commented Jan 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.