List of commits:
Subject Hash Author Date (UTC)
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
AUTHORS file update 69efc5c7617404728506b380a57cf8336a45c2fc Catalin(ux) M. BOIE 2019-09-17 19:03:59
Added TLS1.3 to the list of protocols for nginx c9fe2cc833c1a9636eab4baa2c388b2ea073ecbb Catalin(ux) M. BOIE 2019-09-17 19:03:23
History updates 3de26500d13dc1eafa00fa4721704c5cfe372fd7 Catalin(ux) M. BOIE 2019-09-17 19:01:08
Destroy confirmation link after use 6794a957bf695525b1a171eb6b602d228fd0f725 Catalin(ux) M. BOIE 2019-04-01 17:41:47
Show rg_log_sid into the user output to help identifying the logs f272e87bcb5fef0e34459c5025b3d4bc796dab6d Catalin(ux) M. BOIE 2018-08-29 21:40:36
SELinux updates 04b76e731f34762838434e8412e283be7360d188 Catalin(ux) M. BOIE 2018-08-29 21:36:29
Corrected wrong help for ssh 2fa 04f8223c0c8fc585d3c7882c17ba4ecb7c22d0b5 Catalin(ux) M. BOIE 2018-08-29 21:36:16
ldap changes 89e6848701e4c27d0f089393c7591302c45c57d4 Catalin(ux) M. BOIE 2018-08-29 21:35:56
Allow login token to be appended to the password 8a5b003845f54d2771beaec7b14b96b2029ee9db Catalin(ux) M. BOIE 2018-08-29 21:35:16
Cosmetic changes for the theme e8ed0db5fd9b41c5a63e1e171adb615a33817da8 Catalin(ux) M. BOIE 2018-08-29 21:32:36
samples updated b42d3dd5947ae9bcf3994854219e759d93abcafa Catalin(ux) M. BOIE 2018-08-29 21:32:03
docker updates f26097f046666d3ab5ca96e69f6fc458188a33ed Catalin(ux) M. BOIE 2018-08-29 21:31:16
Cosmetic changes d5069178bed9736db02c3233e95564ad7b429e17 Catalin(ux) M. BOIE 2018-08-29 21:30:42
tests: added helper for totp enrollment bad21ca093b427b200b3fbdcf2a2e1dd1820f93a Catalin(ux) M. BOIE 2018-08-29 20:59:17
Store the timestamp of the deletion for a repo, not 1 e761b36efaa37fc3c453e8382127e340bc736bc7 Catalin(ux) M. BOIE 2018-06-04 18:00:35
totp: urlencode must be used when building the url for 2fa f85ea05bf4b456cc0430e78f2705347dc79343ae Catalin(ux) M. BOIE 2018-05-29 17:39:06
totp: remove expired entries 06cd360eff667740bcf8a580447cb86f3c2e6850 Catalin(ux) M. BOIE 2018-05-29 17:38:16
Show disk size in users list 9cc05cb0307cf31d6d2ebacda0846b0774e704d7 Catalin(ux) M. BOIE 2017-12-25 08:09:22
Commit 25fbc904e16076cc6117a1bb900326344dba9d37 - Did some debug changes for git
Author: Catalin(ux) M. BOIE
Author date (UTC): 2019-09-17 19:24
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2019-09-17 19:24
Parent(s): 4111a8a6ba1e100b3e01d277b2bc7968df9639b1
Signer:
Signing key:
Signing status: N
Tree: 2de5765d94b26526f286c641add92fdc17f0d16e
File Lines added Lines deleted
inc/git.inc.php 67 34
inc/log.inc.php 1 1
File inc/git.inc.php changed (mode: 100644) (index 18a253d..aa164be)
... ... function rg_git_set_error($str)
18 18 { {
19 19 global $rg_git_error; global $rg_git_error;
20 20 $rg_git_error = $str; $rg_git_error = $str;
21 rg_log($str);
21 rg_log('git_set_error: ' . $str);
22 22 } }
23 23
24 24 function rg_git_error() function rg_git_error()
 
... ... function rg_git_diff2array($diff, &$out)
683 683 global $rg_git_debug; global $rg_git_debug;
684 684
685 685 rg_prof_start("git_diff2array"); rg_prof_start("git_diff2array");
686 //rg_log_ml("DEBUG: git_diff2array: diff: " . $diff);
686 rg_log_enter('git_diff2array');
687 if ($rg_git_debug > 90) {
688 rg_log_ml("DEBUG: git_diff2array: diff: " . $diff);
689 rg_log_ml("DEBUG: git_diff2array: out: " . print_r($out, TRUE));
690 }
687 691
688 692 $ret = TRUE; $ret = TRUE;
689 693 $lines = explode("\n", $diff); $lines = explode("\n", $diff);
690 unset($diff); // manually free data
691 //rg_log_ml("DEBUG: lines: " . print_r($lines, TRUE));
694 //if ($rg_git_debug > 90) {
695 // rg_log_ml("DEBUG: lines: " . print_r($lines, TRUE));
692 696 foreach ($lines as $line) { foreach ($lines as $line) {
693 697 if ($rg_git_debug > 90) if ($rg_git_debug > 90)
694 698 rg_log("DEBUG: line=$line"); rg_log("DEBUG: line=$line");
 
... ... function rg_git_diff2array($diff, &$out)
721 725
722 726 $file = $a['file']; $file = $a['file'];
723 727 if (!isset($out[$file])) { if (!isset($out[$file])) {
728 rg_log_ml('DEBUG: out: ' . print_r($out, TRUE));
729 rg_log('DEBUG: line=' . $line);
724 730 rg_git_set_error('internal error'); rg_git_set_error('internal error');
725 731 rg_internal_error('we have a diff for a' rg_internal_error('we have a diff for a'
726 732 . ' non-existing file (' . $file . ')'); . ' non-existing file (' . $file . ')');
 
... ... function rg_git_diff2array($diff, &$out)
808 814
809 815 $_t = explode(" ", $line, 5); $_t = explode(" ", $line, 5);
810 816 if (count($_t) < 4) { if (count($_t) < 4) {
817 rg_log_ml('DEBUG: diff: ' . print_r($diff, TRUE));
811 818 rg_internal_error("invalid line [$line]: count < 4"); rg_internal_error("invalid line [$line]: count < 4");
812 819 $ret = FALSE; $ret = FALSE;
813 820 break; break;
 
... ... function rg_git_diff2array($diff, &$out)
862 869 break; break;
863 870 } }
864 871
872 rg_log_exit();
865 873 rg_prof_end("git_diff2array"); rg_prof_end("git_diff2array");
866 874 return $ret; return $ret;
867 875 } }
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
950 958 break; break;
951 959 } }
952 960
953 if ($rg_git_debug > 70)
954 rg_log_ml("DEBUG: OUTPUT OF GIT LOG: " . $a['data']);
961 if ($rg_git_debug > 95) {
962 rg_log_enter('DEBUG: OUTPUT OF GIT LOG START');
963 rg_log_ml($a['data']);
964 rg_log_exit();
965 }
955 966
956 967 $blocks = explode($sep_start, $a['data']); $blocks = explode($sep_start, $a['data']);
957 968 unset($a['data']); // manually free memory unset($a['data']); // manually free memory
958 969 // because data starts with the separator, we remove it // because data starts with the separator, we remove it
959 970 unset($blocks[0]); unset($blocks[0]);
960 971
961 //rg_log_ml('DEBUG: blocks: ' . print_r($blocks, TRUE));
972 if ($rg_git_debug > 94) {
973 rg_log_enter('DEBUG: blocks:');
974 rg_log_ml(print_r($blocks, TRUE));
975 rg_log_exit();
976 }
962 977
963 978 $ret = array(); $ret = array();
964 979 foreach ($blocks as $junk => $block) { foreach ($blocks as $junk => $block) {
980 if ($rg_git_debug > 90)
981 rg_log_ml('DEBUG: block: ' . print_r($block, TRUE));
982
965 983 $y = array("vars" => array(), "files" => array()); $y = array("vars" => array(), "files" => array());
966 984
967 985 // some defaults // some defaults
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
970 988 // split block in two: vars and patches // split block in two: vars and patches
971 989 $parts = explode($sep_end, $block, 2); $parts = explode($sep_end, $block, 2);
972 990 unset($block); // manually free memory unset($block); // manually free memory
973 //rg_log_ml('DEBUG: parts: ' . print_r($parts, TRUE));
991 if ($rg_git_debug > 90)
992 rg_log_ml('DEBUG: parts: ' . print_r($parts, TRUE));
974 993
975 994 // vars // vars
976 995 $y['vars']['lines_add'] = 0; $y['vars']['lines_add'] = 0;
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
989 1008 } }
990 1009 } }
991 1010 // Some additions // Some additions
992 $y['vars']['author date UTC'] = gmdate("Y-m-d H:i:s", $y['vars']['author date']);
993 $y['vars']['committer date UTC'] = gmdate("Y-m-d H:i:s", $y['vars']['committer date']);
1011 if (isset($y['vars']['author date']))
1012 $y['vars']['author date UTC'] = gmdate("Y-m-d H:i:s", $y['vars']['author date']);
1013 if (isset($y['vars']['committer date']))
1014 $y['vars']['committer date UTC'] = gmdate("Y-m-d H:i:s", $y['vars']['committer date']);
994 1015
995 1016 if (!isset($parts[1])) { if (!isset($parts[1])) {
996 1017 // we do nothing // we do nothing
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
998 1019 continue; continue;
999 1020 } }
1000 1021
1001 //rg_log_ml('DEBUG parts[1]: ' . print_r($parts[1], TRUE));
1022 if ($rg_git_debug > 90)
1023 rg_log_ml('DEBUG parts[1]: ' . print_r($parts[1], TRUE));
1002 1024 // numstat [+ diff separated by \0\0] // numstat [+ diff separated by \0\0]
1003 1025 $n_d = explode("\0\0", $parts[1]); $n_d = explode("\0\0", $parts[1]);
1004 1026 unset($parts[1]); // manually free data unset($parts[1]); // manually free data
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
1044 1066 'lines_add' => intval($a[0]), 'lines_add' => intval($a[0]),
1045 1067 'lines_del' => intval($a[1]) 'lines_del' => intval($a[1])
1046 1068 ); );
1047 $y['files'][$f]['changes'] =
1048 $y['files'][$f]['lines_add']
1069 $changes = $y['files'][$f]['lines_add']
1049 1070 + $y['files'][$f]['lines_del']; + $y['files'][$f]['lines_del'];
1071 $y['files'][$f]['changes'] = $changes;
1050 1072
1051 1073 // We will mark over sized diffs for later use // We will mark over sized diffs for later use
1052 $changes = $y['files'][$f]['lines_add']
1053 + $y['files'][$f]['lines_del'];
1054 1074 //rg_log('DEBUG: File [' . $f . '] ' //rg_log('DEBUG: File [' . $f . '] '
1055 1075 // . $changes . ' changes'); // . $changes . ' changes');
1056 1076 $y['files'][$f]['oversize_diff'] = $y['files'][$f]['oversize_diff'] =
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
1069 1089
1070 1090 if (!isset($n_d[1])) { if (!isset($n_d[1])) {
1071 1091 // TODO: can happen if the diff is empty? // TODO: can happen if the diff is empty?
1092 rg_log_ml('DEBUG: block: ' . print_r($block, TRUE));
1072 1093 rg_internal_error('patch, but diff missing!'); rg_internal_error('patch, but diff missing!');
1073 1094 rg_git_set_error('internal error'); rg_git_set_error('internal error');
1074 1095 $ret = FALSE; $ret = FALSE;
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
1076 1097 } }
1077 1098
1078 1099 // now, patch, if present // now, patch, if present
1079 if ($rg_git_debug > 80)
1080 rg_log_ml('DEBUG: n_d[1]:' . "\n"
1081 . print_r($n_d[1], TRUE));
1082
1083 1100 $r = rg_git_diff2array($n_d[1], $y['files']); $r = rg_git_diff2array($n_d[1], $y['files']);
1084 if ($r === FALSE)
1101 if ($r === FALSE) {
1102 $ret = FALSE;
1085 1103 break; break;
1104 }
1086 1105
1087 1106 //rg_log_ml('DEBUG: diff2array: ' . print_r($y['files'], TRUE)); //rg_log_ml('DEBUG: diff2array: ' . print_r($y['files'], TRUE));
1088
1089 1107 //rg_log_ml('DEBUG: y: ' . print_r($y, TRUE)); //rg_log_ml('DEBUG: y: ' . print_r($y, TRUE));
1090 1108 $ret[] = $y; $ret[] = $y;
1091 1109 } }
1092 1110 break; break;
1093 1111 } }
1094 1112
1095 //rg_log_ml('DEBUG: simple: ' . print_r($ret, TRUE));
1113 if ($rg_git_debug > 90)
1114 rg_log_ml('DEBUG: simple: ret: ' . print_r($ret, TRUE));
1096 1115
1097 1116 rg_log_exit(); rg_log_exit();
1098 1117 rg_prof_end('git_log_simple'); rg_prof_end('git_log_simple');
 
... ... function rg_git_log_simple($repo_path, $max, $from, $to, $also_patch, $files,
1100 1119 } }
1101 1120
1102 1121 /* /*
1103 * Works on git_log (without patch) output and detect big diffs.
1104 * Returns an array with all the info needed to prepage a 'git log'.
1122 * Works on git_log (without patch) output to detect big diffs.
1123 * Returns an array with all the info needed to prepare a 'git log'.
1105 1124 * Will return an empty array if normal log should be called. * Will return an empty array if normal log should be called.
1106 1125 */ */
1107 1126 function rg_git_log_detect_big_diff($stat, $from) function rg_git_log_detect_big_diff($stat, $from)
 
... ... function rg_git_log_detect_big_diff($stat, $from)
1195 1214 } }
1196 1215
1197 1216 /* /*
1198 * Show last @max commits, no merges, sort by topo
1199 * @also_patch = TRUE if caller needs also the diff
1200 * TODO: $also_merges: remove --no-merges
1201 * '@from' - it will be excluded from the list of commits
1217 * Show last @max commits, no merges, sort by topo.
1218 * @also_patch = TRUE if caller needs also the diff.
1219 * TODO: $also_merges: remove --no-merges.
1220 * '@from' - it will be excluded from the list of commits.
1202 1221 */ */
1203 1222 function rg_git_log($repo_path, $max, $from, $to, $also_patch, $patch_limit) function rg_git_log($repo_path, $max, $from, $to, $also_patch, $patch_limit)
1204 1223 { {
1224 global $rg_git_debug;
1225
1205 1226 rg_prof_start('git_log'); rg_prof_start('git_log');
1206 1227 rg_log_enter('git_log: repo_path=' . $repo_path . ' from=' . $from rg_log_enter('git_log: repo_path=' . $repo_path . ' from=' . $from
1207 1228 . ' to=' . $to .' max=' . $max); . ' to=' . $to .' max=' . $max);
 
... ... function rg_git_log($repo_path, $max, $from, $to, $also_patch, $patch_limit)
1221 1242 break; break;
1222 1243 } }
1223 1244
1224 rg_log_ml('DEBUG: stat: ' . print_r($stat, TRUE));
1245 //if ($rg_git_debug > 90)
1246 // rg_log_ml('DEBUG: stat: ' . print_r($stat, TRUE));
1247 if (empty($from)) {
1248 $from = $stat[0]['vars']['sha1'];
1249 if ($rg_git_debug > 50)
1250 rg_log('DEBUG: overwriting from with ' . $from);
1251 }
1225 1252
1226 1253 $r = rg_git_log_detect_big_diff($stat, $from); $r = rg_git_log_detect_big_diff($stat, $from);
1227 1254 if (empty($r)) { // = no big diff if (empty($r)) { // = no big diff
 
... ... function rg_git_log($repo_path, $max, $from, $to, $also_patch, $patch_limit)
1244 1271 $x = rg_git_log_simple($repo_path, $max, $x = rg_git_log_simple($repo_path, $max,
1245 1272 $i['from'], $i['to'], $also_patch, $_files, $i['from'], $i['to'], $also_patch, $_files,
1246 1273 $patch_limit); $patch_limit);
1247 if ($x === FALSE)
1274 if ($x === FALSE) {
1275 $stat = FALSE;
1248 1276 break; break;
1277 }
1249 1278 //rg_log_ml('DEBUG: x: ' . print_r($x, TRUE)); //rg_log_ml('DEBUG: x: ' . print_r($x, TRUE));
1250 1279
1251 1280 // Overwrite $stat with the latest info // Overwrite $stat with the latest info
 
... ... function rg_git_log($repo_path, $max, $from, $to, $also_patch, $patch_limit)
1268 1297 break; break;
1269 1298 } }
1270 1299
1271 //rg_log_ml('DEBUG FINAL: ' . print_r($ret, TRUE));
1300 //if ($rg_git_debug > 90)
1301 // rg_log_ml('DEBUG FINAL: ' . print_r($ret, TRUE));
1272 1302
1273 1303 rg_log_exit(); rg_log_exit();
1274 1304 rg_prof_end('git_log'); rg_prof_end('git_log');
 
... ... function rg_git_files($old, $new)
1393 1423 */ */
1394 1424 function rg_git_diff($id, $a, $template_file) function rg_git_diff($id, $a, $template_file)
1395 1425 { {
1426 global $rg_git_debug;
1427
1396 1428 rg_prof_start("git_diff"); rg_prof_start("git_diff");
1397 //rg_log_enter("DEBUG: git_diff: a: " . rg_array2string($a));
1429 rg_log("DEBUG: git_diff: id=$id a: " . rg_array2string($a));
1398 1430
1399 1431 $id = rg_xss_safe($id); $id = rg_xss_safe($id);
1400 1432
1401 1433 $ret = "<div class=\"diff\">\n"; $ret = "<div class=\"diff\">\n";
1402 1434
1403 1435 $x = array(); $x = array();
1404 $template = rg_template($template_file, $x, TRUE /* xss */);
1436 $template = rg_template($template_file, $x, TRUE /*xss*/);
1405 1437
1406 1438 // for each file changed // for each file changed
1407 1439 foreach ($a as $fileindex => $finfo) { foreach ($a as $fileindex => $finfo) {
1408 //rg_log_ml("DEBUG: finfo: " . print_r($finfo, TRUE));
1440 if ($rg_git_debug > 90)
1441 rg_log_ml("DEBUG: finfo: " . print_r($finfo, TRUE));
1409 1442
1410 1443 $ret .= "<br />\n"; $ret .= "<br />\n";
1411 1444
File inc/log.inc.php changed (mode: 100644) (index a574f6f..cdbf680)
... ... if (!isset($rg_log_dir))
6 6 $rg_log_dir = "/var/log/rocketgit"; $rg_log_dir = "/var/log/rocketgit";
7 7
8 8 if (!isset($rg_log_file)) if (!isset($rg_log_file))
9 $rg_log_file = $rg_log_dir . "/fallback.log";
9 $rg_log_file = $rg_log_dir . "/err-fallback.log";
10 10
11 11 $rg_log_fd = FALSE; $rg_log_fd = FALSE;
12 12 $rg_log_sid = rg_id(6); $rg_log_sid = rg_id(6);
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