List of commits:
Subject Hash Author Date (UTC)
Do the right thing (no error) when an empty tree is present 7c138f486a81d09df44e811714d7bdeb92d7c01d Catalin(ux) M. BOIE 2017-03-21 19:34:03
Do not use UA when building anti-CSRF token. Think about plugins which change the UA at every request 7346fceeff8bea1eaa500dd3ce1677deb84f8b77 Catalin(ux) M. BOIE 2017-03-21 16:36:46
Do not create a namespace anymore if the user has the rights to push 13f8037ba76b57ae919758609c523dcbb6588745 Catalin(ux) M. BOIE 2017-03-19 19:44:07
Docker improvements c3c0f8ff3f5a2f9acfeea2e9bbf271cfeae4a8bd Catalin(ux) M. BOIE 2017-03-19 19:43:25
Small changes regarding more debugging in several places 03407e5f7562ac997612c56fd20fe067162ea8de Catalin(ux) M. BOIE 2017-03-19 19:42:58
Some improvements for comparison e3a06443fba2c22009f0bde4ea9c3f201a9803cb Catalin(ux) M. BOIE 2017-03-19 19:41:53
Functional tests improvements 6b82e5a1eaf800a15e42840bc9c889e32a7532f0 Catalin(ux) M. BOIE 2017-03-19 19:40:21
Do not report security violations generated by the functional tests 6028674aa0153d4bc1c46999516f87a6019df6d2 Catalin(ux) M. BOIE 2017-03-19 19:38:23
Admin init form: pass next to user to be able to be cached by browsers c3d9974e92a03a3ec4d093188842330bb7a0cad0 Catalin(ux) M. BOIE 2017-03-17 23:41:10
SELinux: Allow php-fpm to create log files 94962a7b15e91acfa609663185ceab365a89ac98 Catalin(ux) M. BOIE 2017-03-17 23:39:01
Allow anonymous push when using git:// or ssh:// 46d947874f12b7ac7f1ac3fa552f703c498082b2 Catalin(ux) M. BOIE 2017-03-02 22:17:48
tests: now we keep the state c75b10325c24e32b699f22a13c9374e80fe45a2b Catalin(ux) M. BOIE 2017-03-02 22:05:43
No need anymore for usr/lib 58a51962e9025457419fac5051d0840732aeff6c Catalin(ux) M. BOIE 2017-03-02 21:34:11
If nothing found in a folder, xargs will fail 9ea8a34050bc2ce4c53e942834f34eaffa5d4f06 Catalin(ux) M. BOIE 2017-03-02 19:50:55
Bump version to 0.66 4f63811dd434780c4342c087757b6003a9c20c9e Catalin(ux) M. BOIE 2017-03-02 17:54:40
Minor change on how do we call fgetcsv 175715a4739e8a33cbd939d847eed9d3d24e24be Catalin(ux) M. BOIE 2017-03-02 17:53:57
Cosmetic changes for comparison 780b0e99bf591c5081eed9ca9cbe2623d3cab22c Catalin(ux) M. BOIE 2017-03-02 17:53:29
Added a custom csv line parsing (partial) for when the program will be re-written in C 746560420021d148c58578af77c9f7bb05cc5918 Catalin(ux) M. BOIE 2017-03-02 17:53:05
Do not test doit != 1 because it can be a bigger number (thanks w3af!) 214dfb3cd1c7e5a3b5a0353a4c9f9b63cb6545f2 Catalin(ux) M. BOIE 2017-03-02 17:51:56
TODO add/delete 1c8ffca4d65be53acdfe21d4c3c0888707f5d10b Catalin(ux) M. BOIE 2017-03-02 17:50:28
Commit 7c138f486a81d09df44e811714d7bdeb92d7c01d - Do the right thing (no error) when an empty tree is present
Author: Catalin(ux) M. BOIE
Author date (UTC): 2017-03-21 19:34
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2017-03-21 19:34
Parent(s): 7346fceeff8bea1eaa500dd3ce1677deb84f8b77
Signer:
Signing key:
Signing status: N
Tree: c7f277b584ca65f509a0802060dc88494aa7e354
File Lines added Lines deleted
inc/git.inc.php 12 4
root/themes/default/repo/tree/nodata.html 1 1
tests/Makefile 1 1
tests/_run_tests.sh 1 1
tests/source.php 90 0
File inc/git.inc.php changed (mode: 100644) (index 2fb12de..f178830)
... ... function rg_git_ls_tree($repo_path, $tree, $path)
579 579 } }
580 580
581 581 $a['data'] = trim($a['data']); $a['data'] = trim($a['data']);
582 if (empty($a['data']) && !empty($path)) {
583 rg_git_set_error('path does not exists');
584 break;
585 }
586
587 $ret = array();
588
582 589 if (empty($a['data'])) { if (empty($a['data'])) {
583 rg_git_set_error("path does not exists");
590 // It seems to be an empty tree
584 591 break; break;
585 592 } }
586 593
587 594 $output = explode("\n", trim($a['data'])); $output = explode("\n", trim($a['data']));
588 $ret = array();
589 595 foreach ($output as $line) { foreach ($output as $line) {
590 596 //rg_log('DEBUG: processing line [' . $line . ']'); //rg_log('DEBUG: processing line [' . $line . ']');
591 597 $_y = array(); $_y = array();
 
... ... function rg_git_log($path, $max, $from, $to, $also_patch)
920 926 } }
921 927 } }
922 928
923 if ($also_patch) {
929 if (!isset($parts[1])) {
930 // we do nothing
931 } else if ($also_patch) {
924 932 // patches // patches
925 933 $y['files'] = rg_git_diff2array($parts[1], $_extra); $y['files'] = rg_git_diff2array($parts[1], $_extra);
926 934 if ($y['files'] === FALSE) if ($y['files'] === FALSE)
 
... ... function rg_git_log($path, $max, $from, $to, $also_patch)
929 937 $y['vars']['lines_add'] = $_extra['lines_add']; $y['vars']['lines_add'] = $_extra['lines_add'];
930 938 $y['vars']['lines_del'] = $_extra['lines_del']; $y['vars']['lines_del'] = $_extra['lines_del'];
931 939 } else { } else {
932 // stortstat
940 // shortstat
933 941 //rg_log('DEBUG parts[1]: ' . print_r($parts[1], TRUE)); //rg_log('DEBUG parts[1]: ' . print_r($parts[1], TRUE));
934 942 $t = explode(',', $parts[1]); $t = explode(',', $parts[1]);
935 943
File root/themes/default/repo/tree/nodata.html changed (mode: 100644) (index 3d2cd5d..4686a89)
1 1 <div class="mess ok"> <div class="mess ok">
2 Tree is empty or an error occurred.
2 Tree is empty.
3 3 </div> </div>
File tests/Makefile changed (mode: 100644) (index dedc55e..eead868)
... ... clean:
14 14 http.arond *.pub git2key git2 *.in q_merge_requests/mr-* \ http.arond *.pub git2key git2 *.in q_merge_requests/mr-* \
15 15 qstats/* repos/* helper helper.pub keys/* ca *.pid \ qstats/* repos/* helper helper.pub keys/* ca *.pid \
16 16 _pr_anon.git *.tmp base ubase wh_cloud.git export.json \ _pr_anon.git *.tmp base ubase wh_cloud.git export.json \
17 .by_http
17 .by_http temp_repos
18 18
19 19 .PHONY: clean_state .PHONY: clean_state
20 20 clean_state: clean_state:
File tests/_run_tests.sh changed (mode: 100755) (index 0f417b0..c5008c4)
... ... tests="by_http wh_lambda http_keys http_forgot \
5 5 http_admin http_bug \ http_admin http_bug \
6 6 http_create_account http_login http_settings http_csrf http_top \ http_create_account http_login http_settings http_csrf http_top \
7 7 token util log state cache prof event rights keys user repo git \ token util log state cache prof event rights keys user repo git \
8 bug hook_update git2"
8 bug hook_update git2 source"
9 9
10 10 failed="" failed=""
11 11 add="" add=""
File tests/source.php added (mode: 100644) (index 0000000..103ac97)
1 <?php
2 error_reporting(E_ALL | E_STRICT);
3 ini_set("track_errors", "On");
4
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
7 require_once($INC . "/init.inc.php");
8 require_once($INC . "/git.inc.php");
9 require_once("helpers.inc.php");
10 require_once("http.inc.php");
11
12 rg_log_set_file("source.log");
13
14 $rg_sql = "host=localhost user=rocketgit dbname=rocketgit connect_timeout=10";
15 $rg_no_db = TRUE;
16 require_once("common.php");
17
18 $_testns = 'source';
19 $rg_cache_enable = TRUE;
20
21
22 rg_test_create_user($db, $rg_ui);
23 rg_log('Created user ' . $rg_ui['uid']);
24 rg_test_create_repo($db, $rg_ui, $repo);
25 rg_log('Created repo ' . $repo['repo_id']);
26 $r = test_login($test_url, $rg_ui, $good_sid);
27 if ($r === FALSE) {
28 rg_log("Cannot login!");
29 exit(1);
30 }
31
32
33 rg_log('');
34 rg_log_enter('Uploading a key...');
35 rg_test_upload_ssh_key($db, $rg_ui, 'source', $good_sid);
36 rg_log_exit();
37
38
39 rg_log('');
40 rg_log_enter('Trying to push master with an empty file...');
41 $cmsg = time() . ' commit message';
42 $remote = 'ssh://rocketgit@' . $rg_ssh_host . ':' .$rg_ssh_port
43 . '/user/' . escapeshellarg($rg_ui['username'])
44 . '/' . escapeshellarg($repo['name']);
45 $r = rg_exec('mkdir -p temp_repos && cd temp_repos'
46 . ' && rm -rf .source && mkdir .source && cd .source'
47 . ' && git init && git commit --allow-empty -m "' . $cmsg . '"'
48 . ' && git remote add origin ' . $remote
49 . ' && export GIT_SSH_COMMAND="ssh -v -o IdentityFile=../../keys/source -o IdentitiesOnly=yes"'
50 . ' && git push origin master',
51 '', FALSE, FALSE);
52 if ($r['ok'] != 1) {
53 rg_log_ml('out: ' . $r['errmsg']);
54 rg_log("Seems I cannot push master! err=$err");
55 exit(1);
56 }
57 $data = array();
58 $headers = array("Cookie: sid=" . $good_sid);
59 rg_log('Check "log" menu...');
60 $r = do_req($test_url . '/user/' . rawurlencode($rg_ui['username'])
61 . '/' . rawurlencode($repo['name']) . '/source/log',
62 $data, $headers);
63 if ($r === FALSE) {
64 rg_log('Cannot load source/log page!');
65 exit(1);
66 }
67 if (!strstr($r['body'], $cmsg)) {
68 rg_log_ml('r: ' . print_r($r, TRUE));
69 rg_log('I cannot find [' . $cmsg . '] inside the body!');
70 exit(1);
71 }
72 rg_log('Check "Tree" menu...');
73 $r = do_req($test_url . '/user/' . rawurlencode($rg_ui['username'])
74 . '/' . rawurlencode($repo['name']) . '/source/tree',
75 $data, $headers);
76 if ($r === FALSE) {
77 rg_log('Cannot load source/tree page!');
78 exit(1);
79 }
80 if (!strstr($r['body'], 'Tree is empty.')) {
81 rg_log_ml('r: ' . print_r($r, TRUE));
82 rg_log('I cannot find [Tree is empty.] inside the body!');
83 exit(1);
84 }
85
86 rg_log_exit();
87
88
89 rg_log("OK!");
90 ?>
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