simonwagner / mergepbx

script for merging XCode project files in git
GNU General Public License v3.0
1.04k stars 45 forks source link

mergepbx cannot handle paths with whitespace #20

Closed floriskruisselbrink closed 2 years ago

floriskruisselbrink commented 8 years ago

The path to my project.pbxproj file contains whitespace:

Foo Project.xcodeproj/project.pbxproj

I cannot get mergepbx to work with this. My first attemt was this:

$ grep bin/mergepbx ~/.gitconfig
cmd = /usr/local/bin/mergepbx -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE"

$ git mergetool --tool=mergepbx
Merging:
Foo Project.xcodeproj/project.pbxproj
[..]
usage: mergepbx [-h] [-o OUTPUT] [-d] [--dump DUMP] [--clean] [--no-clean]
                base mine theirs
mergepbx: error: unrecognized arguments: ./Foo Project.xcodeproj/project_LOCAL_42551.pbxproj ./Foo Project.xcodeproj/project_REMOTE_42551.pbxproj

The errormessage makes me assume that "./Foo" gets assigned to output, " Project.xcodeproj/project.pbxproj" to base, "./Foo" to mine and "Project.xcodeproj/project_BASE_42551.pbxproj" to theirs, as if the spaces are incorrectly treated as argument separators.

The same .gitconfig line works perfectly fine for p4merge or kdiff3. I also tried various combinations of escaping and extra quotes, but all of the following give the exact same result:

cmd = /usr/local/bin/mergepbx -o \"$MERGED\" \"$BASE\" \"$LOCAL\" \"$REMOTE\"
cmd = /usr/local/bin/mergepbx -o "\"$MERGED\"" "\"$BASE\"" "\"$LOCAL\"" "\"$REMOTE\""
cmd = /usr/local/bin/mergepbx -o \\\"$MERGED\\\" \\\"$BASE\\\" \\\"$LOCAL\\\" \\\"$REMOTE\\\"
cmd = /usr/local/bin/mergepbx -o "\\\"$MERGED\\\"" "\\\"$BASE\\\"" "\\\"$LOCAL\\\"" "\\\"$REMOTE\\\""
simonwagner commented 8 years ago

Should be fixed in v0.10, would you try it again?

floriskruisselbrink commented 2 years ago

Let’s close this, it has most likely been fixed, and after 6 years it's not relevant to me anymore.