(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.
The tests pass on my Linux and Windows systems.
This took much longer than I would have liked. Braid is competing with many other hobbies and tasks for a small slice of my time and energy, and each obstacle I run into can lead to further delay, but I haven't forgotten about it! The good news is that one of the things I did along with this PR that took some extra time was to set up a new development environment that should remove some hassles from my workflow for future contributions.
(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.
The tests pass on my Linux and Windows systems.
This took much longer than I would have liked. Braid is competing with many other hobbies and tasks for a small slice of my time and energy, and each obstacle I run into can lead to further delay, but I haven't forgotten about it! The good news is that one of the things I did along with this PR that took some extra time was to set up a new development environment that should remove some hassles from my workflow for future contributions.
Cheers and happy new year!