X-Git-Url: http://git.pjr.cc/?p=gwvp-mini.git;a=blobdiff_plain;f=bin%2Fgwvpminicmdtool.php;h=1b532650b9c2ae4f0697389712e51aec96ec704f;hp=83bfd068829456c4c48d0c70d74139b627deda53;hb=a0e234c191ea3c1427355eaa596d1e71b730e34a;hpb=333846ace1ec12152bc645ff59f682825dad8f02 diff --git a/bin/gwvpminicmdtool.php b/bin/gwvpminicmdtool.php index 83bfd06..1b53265 100644 --- a/bin/gwvpminicmdtool.php +++ b/bin/gwvpminicmdtool.php @@ -6,11 +6,11 @@ $BASE_URL = "/"; global $WEB_ROOT_FS, $BASE_URL, $IS_WEB_REQUEST, $data_directory, $db_type, $db_name, $db_username, $db_password, $IS_WEB_REQUEST, $cmd_line_tool; $IS_WEB_REQUEST = false; -if(file_exists("../www/config.php")) require_once("../www/config.php"); +if(file_exists("$WEB_ROOT_FS/../www/config.php")) require_once("$WEB_ROOT_FS/../www/config.php"); else if(file_exists("/etc/gwvpmini/config.php")) require_once("/etc/gwvpmini/config.php"); else $noconfig = true; -if(file_exists("../gwvpmini/gwvpmini.php")) require_once("../gwvpmini/gwvpmini.php"); +if(file_exists("$WEB_ROOT_FS/../gwvpmini/gwvpmini.php")) require_once("$WEB_ROOT_FS/../gwvpmini/gwvpmini.php"); else if(file_exists("/usr/share/gwvpmini/lib/gwvpmini/gwvpmini.php")) require_once("/usr/share/gwvpmini/lib/gwvpmini/gwvpmini.php"); if(isset($argv["1"])) { @@ -37,18 +37,30 @@ function gwvpcmdtool_Usage() echo "\tupdatehook \n"; } + +// update will log things like branch and tag creations function gwvpcmdtool_UpdateHook() { global $argv; - echo "got ".$argv[2].", ".$argv[3].", ".$argv[4]."\n"; + //echo "got ".$argv[2].", ".$argv[3].", ".$argv[4]."\n"; + if(preg_match("/^000000+$/", $argv[3])) { + // createion of tag or branch + $vals = explode("/", $argv[2]); + $type = "unknowncreate"; + if($vals == "heads") $type = "branchcreate"; + if($vals == "tags") $type = "tagcreate"; + gwvpmini_AddActivityLog("$type", "1", "1", $argv[4], "somelogs"); + } + //gwvpmini_AddActivityLog($type, $userid, $repoid, $commitid, $commitlog) } +// pre-receive logs all commit info function gwvpcmdtool_PreReceive() { global $argv; - echo "got from prereceive ".$argv[2].", ".$argv[3].", ".$argv[4]."\n"; + //echo "got from prereceive ".$argv[2].", ".$argv[3].", ".$argv[4]."\n"; - passthru("git rev-list --reverse ".$argv[3]." --not --all "); + //passthru("git rev-list --reverse ".$argv[3]." --not --all "); } ?> \ No newline at end of file