$tile_size = 20; /* do not edit */
$max_branches = 30;
+$use_local_branches = true;
+$use_remote_branches = true;
$colors = array(
NULL,
$head_list = shell_exec($cmd);
$head = parse_commit($head_list);
$first_commit = false;
- $data['branches'][0] = array();
- $branch = &$data['branches'][0];
+ $data['branches'][count($data['branches'])] = array();
+ $branch = &$data['branches'][count($data['branches'])-1];
$branch['id'] = $brach_id++;
$branch['uid'] = $branch_uid++;
$branch['active'] = true;
$branch['next'] = $head['id'];
+ unset($branch);
+ if($use_local_branches) {
+ $cmd = "git --git-dir=".$repo_path.$project." for-each-ref --sort=-committerdate refs/heads/";
+ $head_list = shell_exec($cmd);
+ foreach(explode("\n", str_replace("\r", "", $head_list)) as $head) {
+ $head = explode(" ", $head);
+ if(!$head[0])
+ continue;
+ $existing = false;
+ foreach($data['branches'] as $branch) {
+ if($branch['next'] == $head[0]) {
+ $existing = true;
+ break;
+ }
+ }
+ if($existing)
+ continue;
+ $data['branches'][count($data['branches'])] = array(
+ "id" => $brach_id++,
+ "uid" => $brach_uid++,
+ "active" => true,
+ "next" => $head[0]
+ );
+ }
+ }
+ if($use_remote_branches) {
+ $cmd = "git --git-dir=".$repo_path.$project." for-each-ref --sort=-committerdate refs/remotes/";
+ $head_list = shell_exec($cmd);
+ foreach(explode("\n", str_replace("\r", "", $head_list)) as $head) {
+ $head = explode(" ", $head);
+ if(!$head[0])
+ continue;
+ $existing = false;
+ foreach($data['branches'] as $branch) {
+ if($branch['next'] == $head[0]) {
+ $existing = true;
+ break;
+ }
+ }
+ if($existing)
+ continue;
+ $data['branches'][count($data['branches'])] = array(
+ "id" => $brach_id++,
+ "uid" => $brach_uid++,
+ "active" => true,
+ "next" => $head[0]
+ );
+ }
+ }
}
for($i = 0; $i <= intval($_GET['to']); $i++) {