got a working git backend with web push. however, it'll need some
authorpaulr <me@pjr.cc>
Sun, 6 Nov 2011 17:36:06 +0000 (04:36 +1100)
committerpaulr <me@pjr.cc>
Sun, 6 Nov 2011 17:36:06 +0000 (04:36 +1100)
explaining when a user creates a repo for the first time

gwvplib/gwvpgitcontrol.php

index 4622f27..dddf0b2 100644 (file)
@@ -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;
                                        }