From: paulr Date: Sun, 6 Nov 2011 17:36:06 +0000 (+1100) Subject: got a working git backend with web push. however, it'll need some X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=commitdiff_plain;h=4bf1f2ca1b688395eac6e2517fdbce4e87cce0d5 got a working git backend with web push. however, it'll need some explaining when a user creates a repo for the first time --- diff --git a/gwvplib/gwvpgitcontrol.php b/gwvplib/gwvpgitcontrol.php index 4622f27..dddf0b2 100644 --- a/gwvplib/gwvpgitcontrol.php +++ b/gwvplib/gwvpgitcontrol.php @@ -102,6 +102,9 @@ function gwvp_gitBackendInterface() // now we need to rebuild the actual request or do we? //$basegit = "$BASE_URL/git/something.git"; //$newloc = preg_replace("/^$basegit/", "", $_SERVER["REQUEST_URI"]); + chdir("$repo_base/$repo"); + exec("/usr/bin/git update-server-info"); + if($_SERVER["REQUEST_METHOD"] == "POST") { gwvp_AskForBasicAuth(); gwvp_callGitBackend($repo); @@ -190,6 +193,8 @@ function gwvp_callGitBackend($repo) error_log("path trans'd is /tmp/$repo/$euri from $ruri with ".$_REQUEST["q"]." $strrem"); + + $pwd = "/tmp/"; @@ -249,9 +254,14 @@ function gwvp_callGitBackend($repo) // i.e. why the pointer doesnt increment over it, cause the freads above then get them again. if($firstline) { if(strlen($from_cgi_data_t)>0) { + // i dont get why this happens, and its very frustrating.. im not sure if its a bug in php + // or something the git-http-backend thing is doing.. + // TODO: find out why this happens $from_cgi_data = preg_replace("/^\r\n/", "", $from_cgi_data_t); if(strlen($from_cgi_data)!=strlen($from_cgi_data_t)) { error_log("MOOOKS - we did trunc"); + } else { + error_log("MOOOKS - we did not trunc"); } $firstline = false; }