1

Context:

I have a Mac app. I want to include Git in this app because some functions of my app use Git and I don't want the user to have to install it on his machine.

I have downloaded Git from source. I edited the Makefile to declare these two lines:

NO_GETTEXT="yesPlease"
CURLDIR=/usr/local

The first line tells the build process to skip localizing and just use English. The second line declares the path to where libcurl is installed. I downloaded libcurl_devel and built it from source. This is required to enable Git to pull/push from http and https repos.

Git builds successfully. I then copy all of the resulting files into my app's bundle. I'm using NSTask to run Git and attempt to pull an https://-based repo.

The Problem:

The error I get is:

fatal: Unable to find remote helper for 'https'

I googled this, and everyone said that as long as I had libcurl installed when I built Git, Git would work with HTTP and HTTPS addresses. And, in fact, if I run the installed Git from the command line, it does!

What I Need:

So, I must be missing a path setting or an environment variable or SOMETHING that tells Git where to find those remote helpers. They ARE in my app bundle; the screenshot below shows them:

enter image description here

So: what the hell do I need to set in order to resolve this problem when I run Git from within my application bundle?

Community
  • 1
  • 1
Bryan
  • 4,628
  • 3
  • 36
  • 62
  • I'm just stabbing in the dark here, but shouldn't you point the bundled Git at a libcurl that's also bundled rather than locally installed? – jscs Jan 13 '14 at 03:05
  • From what I read, libcurl was only needed while building Git. I don't think it needs to be bundled with the app. And the error seems to imply that Git can't locate the "git-remote-https" helper in the screenshot. – Bryan Jan 13 '14 at 03:08

1 Answers1

1

Unbelievable. I've been trying to fix this for 8+ hours and five minutes after I finally break down and post this question, I figure it out:

Git has an option called --exec-path. I had been passing this argument to the NSTask like this (Where APP BUNDLE is replaced by the path to the application bundle on the user's machine):

--exec-path=[APP BUNDLE]/git/bin

Since bin was the folder where the Git binary was located, I figured that was the appropriate path. However, if I do this:

--exec-path=[APP BUNDLE]/git/libexec/git-core

It works.

Bryan
  • 4,628
  • 3
  • 36
  • 62