-
Notifications
You must be signed in to change notification settings - Fork 48
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
Spaces in command arguments break things #88
Comments
Without testing, it looks like the problem is that you have a space in your username and Braid joins command arguments with spaces and passes the result to the shell without any quoting. However, it's generally advisable (even on unix-like OSes) to avoid spaces in file paths for software development work because lots of less-used development tools have such bugs, although as they get more used, the bugs tend to get fixed (as is happening here with Braid). Indeed, in some programming environments such as makefiles, trying to defend against all characters treated specially by the shell entails so much clutter in the code that it's considered better to require users not to use those characters; maybe we should be moving off of those environments, but realistically we will be stuck with them for many years. In fact, I think the removal of spaces from a lot of default folder names in Windows Vista (e.g., |
Your are right, the problem was the space in my username. |
I'm glad to have confirmation of what the problem was and that you worked around it. This is still a bug in Braid. |
I'll be glad to see this issue fixed. In my scenario, it was just one folder, that I had to rename and add an _ instead of space, but on some cases, there are several directories one inside the other where there are spaces in few of them. |
I'm working on getting the |
(Since each of these changes requires extensive reworking of operations.rb and review of all its callers, it's efficient to make both changes together.) To fix the handling of spaces (and perhaps other characters as well) in shell command arguments, we just keep the arguments as a list of strings all the way to an Open3.capture3 (or similar) that doesn't use the shell, instead of joining the arguments with spaces. I added one integration test of each Braid command with spaces in the file paths. I'm still mostly avoiding nontrivial changes to Braid's runtime behavior, preferring to leave them to a separate pull request. A notable exception: when generating a remote name, Braid now replaces a much larger set of characters with underscores. For the new tests to pass, I had to at least replace spaces, and I decided to go all the way. Fixes #88.
Command line:
braid add --verbose ssh://git@url.git Externe/project
Output:
braid version : braid 1.1.3
git version : git version 2.27.0.windows.1
The text was updated successfully, but these errors were encountered: