Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
310 stars 59 forks source link

Add support for git editor paths containing spaces #126

Closed mpearson closed 9 months ago

mpearson commented 1 year ago

The amend command breaks when your git editor path (git editor core.config) contains spaces. For example, on my windows machine this option is configured to

"C:\\Program Files\\Sublime Text 3\\subl.exe" -w

Calling split() on this string obviously won't end well. This PR uses shlex.split() (thanks ChatGPT!) which returns the array

['"C:\\Program Files\\Sublime Text 3\\subl.exe"', '-w']

as expected.