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

How can I commit automatically ? #47

Open
Supradyn opened this issue Apr 2, 2013 · 2 comments
Open

How can I commit automatically ? #47

Supradyn opened this issue Apr 2, 2013 · 2 comments

Comments

@Supradyn
Copy link

Supradyn commented Apr 2, 2013

Hi!
I need to commit all files in work_dir like "git commit -a". I can't get it from docs.
And in readme.md its like:

$bld = new Git2\TreeBuilder();
$bld->insert(new Git2\TreeEntry(array(
    "name" => "README.txt",
    "oid" => "63542fbea05732b78711479a31557bd1b0aa2116",
    "attributes" => octdec('100644'),
)));
$tree = $bld->write($repo);

How can I get this oid ? It doesnt work like
$repo->hash("file-path")

@raiviskrumins
Copy link

+1

@chobie
Copy link
Member

chobie commented Oct 28, 2013

sorry for late response.

please check this block. probably I didn't add filename base api so you have to read contents by hand and put it into write api.
https://github.com/chobie/kokuban/blob/master/Kokuban/GistProvider.php#L34

Currently, php-git doesn't defined GIT_OBJ_BLOB constant. so please define it in user land.
https://github.com/libgit2/libgit2/blob/d18713fb4ad1ba3d18a75272e1c1c3eb45715aba/include/git2/types.h#L73

Also, php-git uses old version of libgit2. I want to update libgit2 version foreseeable future but I have many php-extensions to maintain. so maybe It takes log time to upgrade.

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

3 participants