List of commits:
Subject Hash Author Date (UTC)
Disable GC when serving requests from web/fetch/push; we will do it from cron fd16c96f5f0a6d24e0c6aaf45c5a02833579667a Catalin(ux) M. BOIE 2019-09-30 19:48:49
git: fixes display of filenames which are not UTF-8 valid 83b6f641a547a4652aad6e921486d2b91cffdb9f Catalin(ux) M. BOIE 2019-09-30 19:46:07
rg_change_pass missed a log file name e49fc9f8c896414098713e418205d97b2e594c1f Catalin(ux) M. BOIE 2019-09-22 09:32:59
totp: remove a double DELETE sql query and invalidate cache after we remove the data from db ff22d7ddabc1c64a37fcb1749f54321974b0f8d3 Catalin(ux) M. BOIE 2019-09-22 09:28:30
selinux: added map (for packs) 911b2cffa2d754d466a31693af71d6c58639dd9d Catalin(ux) M. BOIE 2019-09-22 06:58:44
Do not allow : char in user name 460b846752c03368990b60efbbf12f74e229bda5 Catalin(ux) M. BOIE 2019-09-22 05:58:37
Do not allow : char in repo name b072ba3cd6c46e2ee7d07dc5890c8671d8462a09 Catalin(ux) M. BOIE 2019-09-22 05:56:56
Fix an XSS in repo description ee2d11f0b16b436d9e64a0c5ac57361d25e098e1 Catalin(ux) M. BOIE 2019-09-22 05:45:11
Do not allow a user name to start with minus; strlen -> mb_strlen 755f2a47e99dc3a56cee90b424ee8a9bd84236f8 Catalin(ux) M. BOIE 2019-09-22 05:07:01
Do not allow a repo to start with minus; strlen -> mb_strlen 8ac45126805015c868ae8054ea328dc5a16cf31c Catalin(ux) M. BOIE 2019-09-22 05:06:41
Limit the desciption of the project to 100 chars to be able to pack more repos per page 1d2714726347b1eb9f113bd9c4d65d301d6502bd Catalin(ux) M. BOIE 2019-09-22 04:59:11
Changed CIF 47e6a7b3939898729d4344b8e3a01ac0dbd3e3b1 Catalin(ux) M. BOIE 2019-09-22 04:42:59
Added git_log1_strange.php to generate strange filenames 66083c9e3e6633c953bd5e77f28d993687ef2b73 Catalin(ux) M. BOIE 2019-09-17 20:01:10
tests: cosmetic stuff 7688f7b901e0fe3a94e2fcb62755af159212d053 Catalin(ux) M. BOIE 2019-09-17 20:00:04
If rg_dir_load returns false, propagate the error 6c8640b1200ae7859097e66dd73ba75857a845a5 Catalin(ux) M. BOIE 2019-09-17 19:48:25
rg_exec - do not return if the program closes stderr c619b6bc77b3a9bd1c4dea8a01ba3422620f4c90 Catalin(ux) M. BOIE 2019-09-17 19:47:26
rg_git_from_to: if to is empty, ignore it. 310506eab4b45a96cd75b69cfe72c54c7c5aa0e6 Catalin(ux) M. BOIE 2019-09-17 19:30:44
TODO changes 25a5232ed436fe23e7f21c8caa6934d3bfcbd6d7 Catalin(ux) M. BOIE 2019-09-17 19:25:33
Did some debug changes for git 25fbc904e16076cc6117a1bb900326344dba9d37 Catalin(ux) M. BOIE 2019-09-17 19:24:23
Add rg_log_sid value to all push methods, to be able to identify the log from the user reports 4111a8a6ba1e100b3e01d277b2bc7968df9639b1 Catalin(ux) M. BOIE 2019-09-17 19:06:32
Commit fd16c96f5f0a6d24e0c6aaf45c5a02833579667a - Disable GC when serving requests from web/fetch/push; we will do it from cron
Author: Catalin(ux) M. BOIE
Author date (UTC): 2019-09-30 19:48
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2019-09-30 19:48
Parent(s): 83b6f641a547a4652aad6e921486d2b91cffdb9f
Signer:
Signing key:
Signing status: N
Tree: 0669ecc3c4a944fcdd43aa65f0bb243cb5124e9b
File Lines added Lines deleted
inc/git.inc.php 21 18
File inc/git.inc.php changed (mode: 100644) (index 8b8cd67..614f334)
... ... $rg_git_zero = "0000000000000000000000000000000000000000";
12 12 $rg_git_empty = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; $rg_git_empty = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
13 13 define('GIT_LINK_MASK', intval(base_convert('160000', 8, 10))); define('GIT_LINK_MASK', intval(base_convert('160000', 8, 10)));
14 14
15 define ('RG_GIT_CMD', 'git -c gc.auto=0');
16
15 17 $rg_git_error = ""; $rg_git_error = "";
16 18
17 19 function rg_git_set_error($str) function rg_git_set_error($str)
 
... ... function rg_git_init($dst)
228 230 // TODO: What to do if the creation fails? // TODO: What to do if the creation fails?
229 231 if (!is_dir($dst . "/rocketgit")) { if (!is_dir($dst . "/rocketgit")) {
230 232 $dst2 = $dst . '.tmp'; $dst2 = $dst . '.tmp';
231 $cmd = 'git init --bare ' . escapeshellarg($dst2);
233 $cmd = RG_GIT_CMD . ' init --bare ' . escapeshellarg($dst2);
232 234 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
233 235 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
234 236 rg_git_set_error("error on init " . $a['errmsg'] . ")"); rg_git_set_error("error on init " . $a['errmsg'] . ")");
 
... ... function rg_git_clone($src, $dst)
278 280 } }
279 281
280 282 if (!file_exists($dst . "/rocketgit")) { if (!file_exists($dst . "/rocketgit")) {
281 $cmd = "git clone --bare " . escapeshellarg($src)
283 $cmd = RG_GIT_CMD . "clone --bare " . escapeshellarg($src)
282 284 . " " . escapeshellarg($dst); . " " . escapeshellarg($dst);
283 285 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
284 286 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
 
... ... function rg_git_type($obj)
321 323 break; break;
322 324 } }
323 325
324 $cmd = 'git cat-file -t ' . escapeshellarg($obj);
326 $cmd = RG_GIT_CMD . ' cat-file -t ' . escapeshellarg($obj);
325 327 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
326 328 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
327 329 rg_git_set_error('error on cat-file (' . $a['errmsg'] . ')'); rg_git_set_error('error on cat-file (' . $a['errmsg'] . ')');
 
... ... function rg_git_content($obj)
347 349
348 350 $ret = FALSE; $ret = FALSE;
349 351 while (1) { while (1) {
350 $cmd = 'git cat-file -p ' . escapeshellarg($obj);
352 $cmd = RG_GIT_CMD . ' cat-file -p ' . escapeshellarg($obj);
351 353 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
352 354 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
353 355 rg_git_set_error('error on cat-file (' . $a['errmsg'] . ')'); rg_git_set_error('error on cat-file (' . $a['errmsg'] . ')');
 
... ... function rg_git_rev_ok($rev)
424 426
425 427 $ret = FALSE; $ret = FALSE;
426 428 while (1) { while (1) {
427 $cmd = 'git rev-parse --verify ' . escapeshellarg($rev);
429 $cmd = RG_GIT_CMD . ' rev-parse --verify ' . escapeshellarg($rev);
428 430 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
429 431 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
430 432 rg_git_set_error("error on rev-parse (" . $a['errmsg'] . ")"); rg_git_set_error("error on rev-parse (" . $a['errmsg'] . ")");
 
... ... function rg_git_whitespace_ok($old, $new)
457 459 if (strcmp($old, $rg_git_zero) == 0) if (strcmp($old, $rg_git_zero) == 0)
458 460 $old = $rg_git_empty; $old = $rg_git_empty;
459 461
460 $cmd = "git diff --check"
462 $cmd = RG_GIT_CMD . " diff --check"
461 463 . " " . escapeshellarg($old) . " " . escapeshellarg($old)
462 464 . " " . escapeshellarg($new); . " " . escapeshellarg($new);
463 465 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
 
... ... function rg_git_merge_base($repo_path, $a, $b)
536 538 } }
537 539 } }
538 540
539 $cmd = 'git'
541 $cmd = RG_GIT_CMD
540 542 . $add . $add
541 543 . ' merge-base' . ' merge-base'
542 544 . ' ' . escapeshellarg($a) . ' ' . escapeshellarg($a)
 
... ... function rg_git_update_ref($repo_path, $ref, $old, $new, $reason)
573 575
574 576 $ret = FALSE; $ret = FALSE;
575 577 while (1) { while (1) {
576 $cmd = 'git --git-dir=' . escapeshellarg($repo_path);
577 $cmd .= ' update-ref';
578 $cmd = RG_GIT_CMD
579 . ' --git-dir=' . escapeshellarg($repo_path)
580 . ' update-ref';
578 581
579 582 if (!empty($reason)) if (!empty($reason))
580 583 $cmd .= " -m " . escapeshellarg($reason); $cmd .= " -m " . escapeshellarg($reason);
 
... ... function rg_git_shortlog($repo_path, $a, $b)
613 616
614 617 $ret = FALSE; $ret = FALSE;
615 618 while (1) { while (1) {
616 $cmd = 'git shortlog'
619 $cmd = RG_GIT_CMD . ' shortlog'
617 620 . ' --git-dir=' . escapeshellarg($repo_path) . ' --git-dir=' . escapeshellarg($repo_path)
618 621 . ' ' . escapeshellarg($a) . ' ' . escapeshellarg($a)
619 622 . '..' . escapeshellarg($b); . '..' . escapeshellarg($b);
 
... ... function rg_git_ls_tree($repo_path, $tree, $path)
649 652 $tree = " HEAD"; $tree = " HEAD";
650 653 } }
651 654
652 $cmd = "git --git-dir=" . escapeshellarg($repo_path)
655 $cmd = RG_GIT_CMD . " --git-dir=" . escapeshellarg($repo_path)
653 656 . " ls-tree --long" . $op . " ls-tree --long" . $op
654 657 . escapeshellarg($tree); . escapeshellarg($tree);
655 658 if (!empty($path)) if (!empty($path))
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
1060 1063 $sep_start = '-=ROCKETGIT-START-' . $id . '=-'; $sep_start = '-=ROCKETGIT-START-' . $id . '=-';
1061 1064 $sep_end = '-=ROCKETGIT_END_OF_VARS-' . $id . '=-'; $sep_end = '-=ROCKETGIT_END_OF_VARS-' . $id . '=-';
1062 1065
1063 $cmd = "git --no-pager"
1066 $cmd = RG_GIT_CMD . " --no-pager"
1064 1067 . " --git-dir=" . escapeshellarg($repo_path) . " --git-dir=" . escapeshellarg($repo_path)
1065 1068 . " log" . " log"
1066 1069 . " --find-copies" . " --find-copies"
 
... ... function rg_git_files($old, $new)
1545 1548 if (strcmp($old, $rg_git_zero) == 0) if (strcmp($old, $rg_git_zero) == 0)
1546 1549 $old = $rg_git_empty; $old = $rg_git_empty;
1547 1550
1548 $cmd = 'git diff --name-only ' . escapeshellarg($old)
1551 $cmd = RG_GIT_CMD . ' diff --name-only ' . escapeshellarg($old)
1549 1552 . ' ' . escapeshellarg($new); . ' ' . escapeshellarg($new);
1550 1553 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
1551 1554 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
 
... ... function rg_git_diff_tree($tree1, $tree2)
2140 2143
2141 2144 $ret = FALSE; $ret = FALSE;
2142 2145 while (1) { while (1) {
2143 $cmd = "git diff-tree -r " . escapeshellarg($tree1)
2146 $cmd = RG_GIT_CMD . " diff-tree -r " . escapeshellarg($tree1)
2144 2147 . " " . escapeshellarg($tree2); . " " . escapeshellarg($tree2);
2145 2148 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
2146 2149 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
 
... ... function rg_git_content_by_file($treeish, $file)
2185 2188
2186 2189 $ret = FALSE; $ret = FALSE;
2187 2190 while (1) { while (1) {
2188 $cmd = 'git show ' . escapeshellarg($treeish) . ':'
2191 $cmd = RG_GIT_CMD . ' show ' . escapeshellarg($treeish) . ':'
2189 2192 . escapeshellarg($file); . escapeshellarg($file);
2190 2193 $a = rg_exec($cmd, '', FALSE, FALSE); $a = rg_exec($cmd, '', FALSE, FALSE);
2191 2194 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
 
... ... function rg_git_archive($repo_path, $treeish, $archive_name, $format)
2297 2300
2298 2301 $ret = FALSE; $ret = FALSE;
2299 2302 while (1) { while (1) {
2300 $cmd = 'git --git-dir=' . escapeshellarg($repo_path)
2303 $cmd = RG_GIT_CMD . ' --git-dir=' . escapeshellarg($repo_path)
2301 2304 . ' archive --format=' . escapeshellarg($format) . ' archive --format=' . escapeshellarg($format)
2302 2305 . ' --output=' . escapeshellarg($archive_name) . ' --output=' . escapeshellarg($archive_name)
2303 2306 . ' ' . escapeshellarg($treeish); . ' ' . escapeshellarg($treeish);
 
... ... function rg_git_merge_tree($repo_path, $base, $a, $b)
2365 2368 break; break;
2366 2369 } }
2367 2370
2368 $cmd = 'git --git-dir=' . escapeshellarg($repo_path)
2371 $cmd = RG_GIT_CMD . ' --git-dir=' . escapeshellarg($repo_path)
2369 2372 . ' merge-tree' . ' merge-tree'
2370 2373 . ' ' . escapeshellarg($base) . ' ' . escapeshellarg($base)
2371 2374 . ' ' . escapeshellarg($a) . ' ' . escapeshellarg($a)
 
... ... function rg_git_request_pull($repo_path, $start, $url, $end, $patch)
2517 2520 break; break;
2518 2521 $text .= $r; $text .= $r;
2519 2522
2520 $cmd = 'git diff -M --stat --summary';
2523 $cmd = RG_GIT_CMD . ' diff -M --stat --summary';
2521 2524 if ($patch) if ($patch)
2522 2525 $cmd .= ' --patch'; $cmd .= ' --patch';
2523 2526 $cmd .= escapeshellarg($start) . '..' . escapeshellarg($end); $cmd .= escapeshellarg($start) . '..' . escapeshellarg($end);
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://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

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