Repository navigation
Conversation
mathiasrw
marked this pull request as draft
October 23, 2026 13:05
mathiasrw
marked this pull request as ready for review
October 23, 2026 13:10
mathiasrw
marked this pull request as draft
October 23, 2026 14:14
mathiasrw
marked this pull request as ready for review
October 23, 2026 14:17
mathiasrw
marked this pull request as draft
October 23, 2026 14:45
mathiasrw
marked this pull request as ready for review
October 23, 2026 14:47
mathiasrw
marked this pull request as draft
October 23, 2026 15:03
mathiasrw
marked this pull request as ready for review
October 23, 2026 15:08
mathiasrw
force-pushed
the
fix/826
branch
2 times, most recently
from
October 23, 2026 15:53
228bd3a to
6405fdb
Compare
…e new name for dots and spaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #826
Stacked on #812.
Change
--renameand--rename-pathremove control characters from the new name: the characters below space in ASCII (0x00 to 0x1F, like the line break, the tab and the null byte) and DEL (0x7F). Windows does not allow them in a name, and on Linux and macOS they break scripts andls.The common case is the line break at the end of a replacement file:
Before, the file got the name
b, a line break, and.md.--verbosetells when characters were removed. The help and the README say so too.Tests
yarn test-cipasses: the demo on Node and Bun, and 1033 Bun tests.test/fix/826.test.jsis new, and fails without the fix.After the review of 24 October
--rename-path. Before,rr zzz yyy '*.md' --renamerenameda<tab>b.mdtoab.md..or..is a clash (exit code 3), like when all that was left were control characters.--rename-pathsays so too.After the review of 24 October
Closes #848
Closes #843
The removal of control characters is replaced by a clash, as decided in #848. Nothing is cleaned any more, so the edge cases of cleaning are gone too, like
--jscode that gives the old name back and still loses a tab.--renameand--rename-path, a path with a character below space (0x00 to 0x1F, like a line break or a tab) is a clash: the old or the new name of any file in the run, also when the pattern would not change it. No file is renamed, and the exit code is 3. With--replacement-filethe message says to use--trim-filefor the line break at the end of a file..or..), or one that ends with a space or a dot, is a clash too (Fix the checks of new names in --rename: folders, only dots and spaces, and a space or dot at the end #843). Windows does not allow the last two. A name that starts with a dot, like.env, is fine.After the review of 24 October
The
--renamehelp and README now say: "The process will halt before renaming begins if old or new names contain ASCII control characters, end on a space or a dot, or consist only of spaces and dots."Follow-up