Comments (15)
The Systém nemůže nalézt uvedenou cestu.
message seems to be generated by your system; i assume it is the "System cannot find the path specified", please confirm this.
from git.php.
Yes it is.
from git.php.
the $git_path
(path to git executable) seems to be pre-set at the beginning of the GitRepo class, and from glancing at the code, i see no place in which it is changed. Your stack trace indicates it is still set to its default value, which is probably not right on Windows. Set that to the path to your git.exe, and see if that works
if this is indeed the issue, and it isnt documented anywhere, it probably should be
from git.php.
It works. But it's really bad that
- I need to set that every time
- It's public property of the repo
There should be Git::setGitPath($path)
and Git::getGitPath();``that wouldGitRepo
use.
Also it should first try if simply git --version
returns version and use this default if it does. Otherwise git is not in path and it's up to user to fix it somehow.
I don't mean to pry, it's great that such library exists - I wanted to write one myself, but I wanted to try some existing first. And this one is the only with decent API :)
from git.php.
I'm not at all involved with development (so far), only interested in such a library myself (though no time for coding); but hey, this is github -- fork it, fix it, merge it ;)
from git.php.
I first want to make sure the maintainer cares and will merge my PR first ;)
from git.php.
Owner here,
If you want to make a pull request for a Git::setGitPath
method, I will merge that in.
from git.php.
Hi, is this issue closed?!
from git.php.
The issue itself is still present - tests are not working for Windows. But it's a problem with how the tests are written - the library itself works fine.
from git.php.
I know this is a year old but I'm not sure why the path to git needs to be set anyway. On Windows if git is in the system or user path as it should be if you are using git then we don't even need a path set.
$git::set_bin('git');
This works fine for me. Will it not work on Linux/Mac systems?
If it does work for all maybe just make
protected static $bin = 'git';
And then throw an exception and let the user know they need to put 'git' on the system path.
Sorry if I'm missing something here.
from git.php.
That will not work on *nix system, you need the path to execute.
from git.php.
58b52c6 should be good enough for most cases involving windows, and if other issues arise with windows systems, that method can be kept up-to-date with any other needed changes.
from git.php.
ok my mistake. I was thinking that was taken care of when a user installs git on linux/mac by a symlink or by adding usr/bin/git to the path.
Anyway, thanks for building this. I just used it in a deploy script and it's working good :-)
from git.php.
use 'which' to find git and set the property with a __construct(). There is a GnuWIn version of 'which' so this could be a multiplatform solution.This is what I'm doing in one project where I use this library.
Thanks for your work on it. ;-)
Something like this:
public function __construct($binPath = null) { if (empty($binPath)) { $binPath = '/usr/bin/git'; exec('which git', $output, $error); if (!$error) { $binPath = $output[0]; } } $this->set_bin($binPath); }
Obviously the exec() would have to converted to use the proc_* stuff.
from git.php.
Incidentally I ran into this problem on a custom linux used on a NAS device, so it's not restricted to windows.
from git.php.
Related Issues (20)
- error HOT 2
- Array to string conversion HOT 1
- Concurrent handle ?
- How do I set up a sshkey Like this
- Bypass of PHP issue
- Fatal error: Uncaught exception 'Exception' with message 'error: unable to unlink
- On commit not finding use.name nor user.email HOT 2
- 0
- Add this library to Packagist please. HOT 2
- empty Exception thrown HOT 3
- Library doesn't work on FreeBSD HOT 10
- Push where upstream branch does not exist
- Host key verification failure HOT 1
- Line 333 throws error on "config --get alias.example"
- PHP hanging indefinitely due to stream_get_contents HOT 2
- fetch error
- Git Pull/Push error HOT 1
- Thrown ConsoleException when git command returns nothing HOT 1
- Composer 2.0 package-name // Uppercase name will error
- Update library in Packagist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git.php.