Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library doesn't work on FreeBSD #47

Open
josh4trunks opened this issue May 7, 2016 · 10 comments
Open

Library doesn't work on FreeBSD #47

josh4trunks opened this issue May 7, 2016 · 10 comments

Comments

@josh4trunks
Copy link

/usr/bin/git would not normally exist on FreeBSD as it install non-system applications to /usr/local/bin

I'm assuming there is a more portable way to find the git executable then hardcoding the location? I can try finding a solution to this at somepoint but don't have a ton of time to look into it at the moment.

Thanks

@josh4trunks
Copy link
Author

@kbjr Could Git.php instead use protected static $bin = 'git';?
This way systems with proper PATH set for PHP would find git even if it isn't the currently hardcoded /usr/bin/php.

We could then also remove the windows_mode() function since this would be the default. And by leaving the set_bin() function, programs who want to specify a git path that wouldn't normally be found by PHP could still do so.

If you agree with this proposal I can submit a Pull Request. What do you think?

@kbjr
Copy link
Owner

kbjr commented May 13, 2016

I haven't worked on this project for a long time, I don't remember most of the details. That said, I do remember that there was a reason why I hard coded that path, I ran into some issue trying to use just git.

@andrevanzuydam
Copy link

My five cents guys, how about a file_exists check to see where git is on a
system based on the system type and one assumes the defaults. So an array
of default paths for Linux , Windows, MacOS then a simple check to see
whether any of those are there producing the path where the binary is found

On Fri, May 13, 2016 at 2:50 AM, James Brumond [email protected]
wrote:

I haven't worked on this project for a long time, I don't remember most of
the details. That said, I do remember that there was a reason why I hard
coded that path, I ran into some issue trying to use just git.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#47 (comment)

[image: --]

Andre van Zuydam
[image: https://]about.me/andrevanzuydam
https://about.me/andrevanzuydam?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links

[image: http://www.daniweb.com/profiles/1108517/Andre-van-Zuydam]
http://www.daniweb.com/profiles/1108517/Andre-van-Zuydam

[image: https://www.openhub.net/accounts/75973?ref=Detailed]
https://www.openhub.net/accounts/75973?ref=Detailed

@josh4trunks
Copy link
Author

josh4trunks commented May 13, 2016

@kbjr thanks for the reply, that's what I figured based on the commit history.

It looks like the hardcoded /usr/bin/git path has been there since the beginning.

protected $git_path = '/usr/bin/git';

Maybe it was because your PHP didn't have a proper environmental PATH set?

@josh4trunks
Copy link
Author

@andrevanzuydam This would require Git.php have all the possible/common paths hardcoded. Or the program calling Git.php could have this logic instead.

I'd personally prefer just calling 'git' and relying on person deploying their app to have a proper PATH set. And an app could always call a different git path specifically with the set_bin() function.

@josh4trunks
Copy link
Author

My proposal is here #48

@kevinlekiller
Copy link

Can we please get this merged? It's been a long standing issue (there are closed issues about this going back to 2012).

Thanks.

@josh4trunks
Copy link
Author

@kbjr if you'd rather not bother with fixes to this project, maybe there is a fork you could recommend?

thanks

@kevinlekiller
Copy link

This fork seems the most active: https://github.com/coyl/git

@josh4trunks
Copy link
Author

yeah, looks like alot of recent commits there. feel free to duplicate this PR over there, or when I get a chance I can do so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants