Skip to content

feat(users/ignoring): add escaping on Windows #919

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

Merged
merged 5 commits into from
Aug 7, 2025

Conversation

rasa
Copy link
Member

@rasa rasa commented Apr 27, 2025

@tomasz1986 tomasz1986 changed the title feat(users/ignoring): Add escaping on Windows feat(users/ignoring): add escaping on Windows May 6, 2025
@marbens-arch
Copy link
Member

marbens-arch commented May 11, 2025

Should the base branch be main or v2?

@acolomb acolomb added this to the Syncthing v2.x milestone May 11, 2025
@acolomb
Copy link
Member

acolomb commented May 11, 2025

I don't think we have a v2 branch here? The main PR is against v2, so I created a milestone to collect changes here which should not be merged before v2 becomes the "current" release.

@marbens-arch
Copy link
Member

marbens-arch commented May 11, 2025

I don't think we have a v2 branch here?

https://github.com/syncthing/docs/tree/jb/v2

@marbens-arch marbens-arch marked this pull request as draft May 11, 2025 20:33
@acolomb
Copy link
Member

acolomb commented May 11, 2025

Which is the basis for #901, but unrelated to this change here. That's why I added both to the v2 milestone for easily filtering out when the time has come.

@rasa rasa marked this pull request as ready for review May 15, 2025 00:44
@rasa
Copy link
Member Author

rasa commented May 24, 2025

@acolomb Should we add a

.. versionadded:: 2.0.0

say, in the footer of this note?

@rasa rasa force-pushed the rasa-add-stignore-escaping branch from 50763c3 to 6e0f276 Compare May 27, 2025 00:32
@rasa rasa closed this Jun 7, 2025
@rasa
Copy link
Member Author

rasa commented Jun 29, 2025

Reopening per syncthing/syncthing#10058 (comment) .

Should this target main, or https://github.com/syncthing/docs/tree/jb/v2 ?

calmh pushed a commit to syncthing/syncthing that referenced this pull request Aug 5, 2025
Based on the discussion in
https://forum.syncthing.net/t/towards-syncthing-2-0/24072/35 This PR
adds the ability for Windows users to use the pipe character (|) to
escape the metacharacters *, ?, [, and { in .stignore files.

Additionally, this PR adds the ability for the user to set the escape
character to backslash, or any character they want, by adding a line in
the form:

  #escape=X

(where X is any single rune), to the top of an .stignore file.

This would allow users to use the same .stignore file across platforms,
by simply adding

  #escape=\

to the top of the file.

### Testing

All tests pass in CI.

### Documentation

See syncthing/docs#919

Fixes #10057: Support escaping in .stignore files on Windows
Fixes #7547: Ignore pattern with \[ and \] does not work
@tomasz1986 tomasz1986 enabled auto-merge (squash) August 5, 2025 12:29
@calmh calmh disabled auto-merge August 5, 2025 12:29
@calmh
Copy link
Member

calmh commented Aug 5, 2025

Target and merge into v2 please

@calmh
Copy link
Member

calmh commented Aug 5, 2025

And indeed add a .versionadded for 2.0.0 into the appropriate place 🙏

@calmh calmh changed the base branch from main to v2 August 5, 2025 12:55
@calmh
Copy link
Member

calmh commented Aug 5, 2025

I switched the target

@rasa
Copy link
Member Author

rasa commented Aug 6, 2025

And indeed add a .versionadded for 2.0.0 into the appropriate place 🙏

Done.

@calmh calmh merged commit a988359 into syncthing:v2 Aug 7, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants