xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / inc / repo / repo.php (24671e0be8e5411fe2bdb6ec97aab25d534a303d) (1,469B) (mode 100644) [raw]
<?php
rg_log("/inc/repo/repo");

$_repo = "";

if ($rg_ui['uid'] == 0) {
	$_repo .= "You do not have access here!";
	return;
}

$name = rg_var_str("name");
$max_commit_size = rg_var_uint("max_commit_size");
$max_users = rg_var_uint("max_users");
$description = rg_var_str("description");
$master_repo_id = rg_var_uint("master_repo_id");
$rights = @rg_rights_a2s($_REQUEST['rights']);
$repo_id = rg_var_uint("repo_id");
$q = rg_var_str("q");
$masters = rg_var_uint("masters");


// menu
$_url = rg_re_url($op);

$second_menu = array(
	"create_repo" => array(
		"text" => "Create",
		"url" => "&amp;subop=1"
		),
	"list_repos" => array(
		"text" => "List",
		"url" => "&amp;subop=2"
		),
	"search_repo" => array(
		"text" => "Search",
		"url" => "&amp;subop=3"
		)
);

$_body = "";

$errmsg = array();

switch ($subop) {
case 1: // create
	if ($doit == 1) {
		$_r = rg_repo_create($db, $master_repo_id, $rg_ui, $name,
			$max_commit_size, $description, $rights, $max_users);
		if ($_r === FALSE)
			$_body .= rg_repo_error();
		else
			$_body .= "OK!";
	} else {
		$_action = "Create";

		// defaults
		$rights = $rg_repo_rights_default;

		include($INC . "/repo/repo.form.php");
		$_body .= $_form;
	}
	break;

case 2: // list
	$_body .= rg_repo_list($db, "", $rg_ui);
	break;

case 3: // search
	if ($doit == 1) {
		$_body .= rg_repo_search($db, $q, $masters);
	} else {
		include($INC . "/repo/search.form.php");
		$_body .= $_form;
	}
	break;
}

$_repo .= $_body;
?>
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master