-
Notifications
You must be signed in to change notification settings - Fork 110
Fix listing of file names with special characters to avoid crash and unrecognised names #204 #205
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
base: main
Are you sure you want to change the base?
Conversation
…unrecognised names #204 Tweak the file listing to fix two issues found to affect files with problematic names like `"Terrible file""")))(((][][].secret`. This change may undo performance improvements achieved in #193. - Ensure the `git check-attr filter` command does not quote file name characters by using `-z` arg and some extra trickery to keep space and newline delimiter characters for filter metadata and each file name respectively. This fixes a file named `"Terrible file""")))(((][][].secret` being listed as just `Terrible file`. - Adjust checking for `filter` and `crypt` strings to work with changed output from `check-attr` command. - Tweak `eval 'echo $filename'` portion of command to avoid script crash on files with special characters with error message like `eval: line 192: syntax error near unexpected token`
confirmed 😢 |
What exactly is the problem? I must be blind, but I've just created a Do you actually get |
The problem is when a file with problematic characters – like the "Terrible File" example – is added as a secret/encrypted file, its name gets munged by the |
Thing is... I don't seem to get that error 🤔 I created a file with the mentioned filename, I staged it, and |
Hi @andreineculau are you sure you are checking a file with a problematic name when that file is also encrypted, not just staged as a standard file? The problem manifests as the problematic filename not being included in the output of I have added a unit test that demonstrates the problem with the old transcrypt version from I have also made another change in 93ba18f which will hopefully improve performance again for repositories like yours with many files, by using an Can you check the performance of this latest version of this PR? |
this is what I see on my end with the new 94b8599 version
and with the old version I have (with the changes in #193)
👆 NOTE that the difficult file is not detected as encrypted! With the version in 6aa50df --- I just killed So - since we have a test that confirms the fix 🤩 and I can confirm now that the performance is on par with #193 🤩 .... 👏❤️🚀:shipit: |
Tweak the file listing to fix two issues found to affect files with problematic names like
"Terrible file""")))(((][][].secret
.This change may undo performance improvements achieved in #193.
Ensure the
git check-attr filter
command does not quote file name characters by using-z
arg and some extra trickery to keep space and newline delimiter characters for filter metadata and each file name respectively.This fixes a file named
"Terrible file""")))(((][][].secret
being listed as justTerrible file
.Adjust checking for
filter
andcrypt
strings to work with changed output fromcheck-attr
command.Tweak
eval 'echo $filename'
portion of command to avoid script crash on files with special characters with error message likeeval: line 192: syntax error near unexpected token