0

I'm getting errors when cloning a repository with a Git LFS filter using Eclipse eGit.

git-lfs 2.4.0 is installed via brew and in the usual location.

$ which git-lfs
/usr/local/bin/git-lfs

Cloning over HTTPS on the command line works fine.

$ git clone https://...@bitbucket.org/.../<repos>.git
Cloning into '<repos>'...
remote: Counting objects: 3453, done.
remote: Compressing objects: 100% (2289/2289), done.
remote: Total 3453 (delta 1073), reused 3328 (delta 1009)
Receiving objects: 100% (3453/3453), 7.33 MiB | 374.00 KiB/s, done.
Resolving deltas: 100% (1073/1073), done.
Checking out files: 100% (3070/3070), done.
Filtering content: 100% (309/309), 197.75 MiB | 1.80 MiB/s, done.

When cloning with Eclipse Oxygen 4.7.3a and Eclipse eGit 4.9.2, the clone operation works fine, but there is an error when it gets to retrieving LFS assets:

org.eclipse.jgit.api.errors.FilterFailedException:
Execution of filter command 'git-lfs smudge -- '<file1>'' on file '<file1>'
failed with return code '127', message on stderr:
'git-lfs smudge -- '<file1>': git-lfs: command not found'

org.eclipse.jgit.api.errors.FilterFailedException:
Execution of filter command 'git-lfs smudge -- '<file2>'' on file '<file2>'
failed with return code '127', message on stderr:
'git-lfs smudge -- '<file2>': git-lfs: command not found'

It seems that git-lfs in /usr/local/bin is not discovered. If I open a Eclipse terminal, echo $PATH prints:

/usr/bin:/bin:/usr/sbin:/sbin

However, from a standard terminal, echo $PATH prints:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Do I need to add /usr/local/bin to the path that eGit sees? If so, how can that be done?

3 of my colleagues have the same issue and I'm working from a new install of Eclipse IDE for C/C++ Developers.

RjOllos
  • 2,900
  • 1
  • 19
  • 29

1 Answers1

1

I solved this problem by adding the following LSEnvironment tag after the fist tag in my Info.plist file in the Eclipse.app directory. Find Eclipse in your Applications folder, right click on the Eclipse application and select Show Package Contents. Then within the Contents folder you should have an Info.plist file. Open that with your favorite text editor and add the following under the first tag.

<key>LSEnvironment</key>
    <dict>
        <key>PATH</key>
            <string>/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>

Then reregister your application (confirm your Eclipse.app path):

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/Eclipse.app 

More information about the launch services keys is found here: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html

Credit to the author of the following page for giving me the information that showed how to do this: https://wiki.eclipse.org/PTP/photran/documentation/photran8installation#Additional_Instructions_for_Mac_OS_X_Users

Fitz
  • 11
  • 1