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 / log.inc.php (6acb1f64e44a37de258500669d64cd95b06baf06) (667B) (mode 100644) [raw]
<?php
require_once($INC . "/util.inc.php");

$rg_log_file = "/var/log/rocketgit/fallback.log";
$rg_log_fd = FALSE;
$rg_log_sid = rg_id(6);

function rg_log_set_file($file)
{
	global $rg_log_file;

	$rg_log_file = $file;
}

function rg_log($str)
{
	global $rg_log_file;
	global $rg_log_fd;
	global $rg_log_sid;

	if ($rg_log_fd === FALSE) {
		$rg_log_fd = @fopen($rg_log_file, "a");
		if ($rg_log_fd === FALSE)
			return;
		// write an empty line
		fwrite($rg_log_fd, "\n");
	}

	$t = gettimeofday();
	$buf = gmdate("Y-m-d H:i:s", $t['sec']) . "." . sprintf("%03u", $t['usec'] / 1000);
	$buf .= " " . $rg_log_sid . " " . $str . "\n";

	fwrite($rg_log_fd, $buf);
}

?>
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