oleganza / gitbox2

Other
9 stars 0 forks source link

Problem in macOS 13 Ventura (and hacky workaround) #2

Open jeff-h opened 1 year ago

jeff-h commented 1 year ago

I realise this is not really the place to post issues re Gitbox v1, but I thought I'd put this here in case it helps anyone else.

I've just upgraded to Ventura and the dreaded day appears to have arrived... Gitbox v1 finally has issues. On mine, it seems to be using the wrong method to create paths from its filesystem URLs, with the result that they contain %2F where they should have /.

I'll have to put up with that inside the app, but unfortunately it's worse: it breaks the diff viewer integration, because the diff tool cannot find the file at a path such as /Users/bob/Sites/mysite/sites/themes%2Fcharacter%2Ftemplates%2Fhtml.tpl.php

To work around this I've done the following. I use FileMerge and don't have any other diff tools installed, so only FileMerge is available inside Gitbox's prefs.

1) create a bash script at /usr/local/bin/chdiff

2) paste in the following:

#!/bin/sh

echo Converting %2F to /
ARGTWO=${2//%2F/\/}

/usr/bin/opendiff $1 $ARGTWO

3) finally, you’ll need to make it executable: sudo chmod +x /usr/local/bin/chdiff

You should now be able to go into Gitbox's settings, and choose "Changes" as the diff tool. This will cause Gitbox to run our chdiff script which converts any %2F into / in the second arg.

soniktrooth commented 1 year ago

+1 this worked for me. Thanks @jeff-h and please @oleganza can you open the source for v1 so we can fix it?

jeff-h commented 1 year ago

Hmm, I have realised this proxy hack has some limitations unfortunately; I doubt it will work if you use the diff tool to manually select the changes you wish to keep. I don't often, so this is not too big of an issue for me.

I've also discovered it doesn't work once the change has been staged.

More importantly though, we'd need to do a similar proxy implementation for the git binary. However, I've tried various ideas and am just not getting any success.

So right now I don't have a working solution unfortunately.