radicle-dev / radicle-upstream

Desktop client for Radicle.
Other
616 stars 51 forks source link

upstream-proxy should use Git binary installed with Homebrew #2838

Closed geigerzaehler closed 2 years ago

geigerzaehler commented 2 years ago

On macOS the proxy should use the Git binary installed with Homebrew if it is installed. This is necessary because macOS ships with an old version of Git that does not have the necessary features.

Upstream cannot find the Git binary installed by Homebrew because the Homebrew installation location is not in PATH when Upstream is started as an app and not from a shell.

The Git binary provided by Homebrew should be used by upstream-proxy when it runs Git (specifically git push here). The binary should also be considered when checking the Git version during onboarding.

While there are other ways Git can be installed, it is enough to focus on Homebrew because it is the most common installation method. The simplest solution is to use the well known Homebrew paths on M1 and intel (confirm the locations) and try to find Git there.

An alternative approach that we considered is to run SHELL which git where SHELL is the value of the SHELL environment variable or the shell configured in /etc/passwd or /bin/sh. However, this does not work because Homebrew installations don’t configure PATH for non-login shells.

rudolfs commented 2 years ago

Fixed via: https://github.com/radicle-dev/radicle-upstream/commit/124e715195a8a0801e63010c043b8a690ae791df