diff --git a/bin/git-changelog b/bin/git-changelog index bb01b7a..80cecf9 100755 --- a/bin/git-changelog +++ b/bin/git-changelog @@ -478,7 +478,10 @@ main() { rm -f "$tmpfile" else cp -f "$tmpfile" "$changelog" - [[ -n "$GIT_EDITOR" ]] && $GIT_EDITOR "$changelog" + # Use `eval` to handle GIT_EDITOR which contains space and options, + # like ""C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst ". + # Thanks @JanSchulz to inspire me this solution + [[ -n "$GIT_EDITOR" ]] && eval $GIT_EDITOR "$changelog" if [[ $? -ne 0 ]]; then _exit fi