function gwvpmini_RepoViewPageBody()
{
- global $repo_view_call, $MENU_ITEMS;\r
+ global $repo_view_call, $MENU_ITEMS, $BASE_URL;
+
+ $repo_base = gwvpmini_getConfigVal("repodir");\r
+ if($_SERVER["SERVER_PORT"] == 443) $proto="https://";
+ else $proto = "http://";
+ $sname = $_SERVER["SERVER_NAME"];
+
+ $owner = gwvpmini_GetRepoOwnerDetailsFromName($repo_view_call);
+ $desc = gwvpmini_GetRepoDescFromName($repo_view_call);
+
+ $owner_name = $owner["username"];
+
+ error_log("STUFF:".print_r($owner,true));
+ $cloneurl = "git clone $proto$sname$BASE_URL/git/$repo_view_call.git";
+ echo "<textarea rows=1 cols=".strlen($cloneurl).">$cloneurl</textarea><br>";\r
+
+ echo "<h2>".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name</h2>";
+ echo "<b>$desc</b><br>";
+ //echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";
+ $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%H\" -10", "r");
+ $commitids = array();
+ $i = 0;
+ if($rs) {
+ while(!feof($rs)) {
+ $flin = fgets($rs);
+ if($flin !== false) {
+ $commitids[$i] = trim($flin);
+ $i++;
+ }
+ }
+ fclose($rs);
+ } else {
+ echo "No commit logs yet<br>";
+ $commitids = false;
+ }
- echo "In repoview call for $repo_view_call";
+ if($commitids != false) {
+ echo "<hr>Commits<br>";
+ echo "<table border=\"1\">";
+ echo "<tr><th>Committed By</th><th>Date</th><th>Commit Log Entry</th></tr>";
+ foreach($commitids as $ids) {
+ $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%at%n%ce%n%an%n%s\" $ids -1", "r");
+ if($rs) {
+ $flin1 = trim(fgets($rs));
+ $flin2 = trim(fgets($rs));
+ $flin3 = trim(fgets($rs));
+ while(!feof($rs)) {
+ $flin4 = fread($rs, 8192);
+ }
+ $flon = gwvpmini_emailToUserLink($flin2);
+ if(!$flon) {
+ $flon = "$flin3 (external)";
+ }
+ }
+ echo "<tr><td>".get_gravatar($flin2, 18, 'mm', 'g', true)."$flon</td><td>$flin1</td><td>$flin4</td></tr>";
+ }
+ echo "</table>";
+ }
}
\r