Giter VIP home page Giter VIP logo

Comments (15)

lehnerpat avatar lehnerpat commented on August 16, 2024

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.

tomasfejfar avatar tomasfejfar commented on August 16, 2024

Yes it is.

from git.php.

lehnerpat avatar lehnerpat commented on August 16, 2024

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.

tomasfejfar avatar tomasfejfar commented on August 16, 2024

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.

lehnerpat avatar lehnerpat commented on August 16, 2024

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.

tomasfejfar avatar tomasfejfar commented on August 16, 2024

I first want to make sure the maintainer cares and will merge my PR first ;)

from git.php.

kbjr avatar kbjr commented on August 16, 2024

Owner here,

If you want to make a pull request for a Git::setGitPath method, I will merge that in.

from git.php.

melwinm avatar melwinm commented on August 16, 2024

Hi, is this issue closed?!

from git.php.

tomasfejfar avatar tomasfejfar commented on August 16, 2024

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.

isimmons avatar isimmons commented on August 16, 2024

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.

kbjr avatar kbjr commented on August 16, 2024

That will not work on *nix system, you need the path to execute.

from git.php.

kbjr avatar kbjr commented on August 16, 2024

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.

isimmons avatar isimmons commented on August 16, 2024

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.

niel avatar niel commented on August 16, 2024

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.

niel avatar niel commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.