List of commits:
Subject Hash Author Date (UTC)
Fix repo stats when there is no commit inside. 621b0a317b65d9a751d221908b8e1664d96011fa Catalin(ux) M. BOIE 2015-09-11 04:58:31
Added back the repo stats d8d06816223b52ff1d65df502fc6175f26c15518 Catalin(ux) M. BOIE 2015-09-10 04:44:10
TOTP fixes: mostly correct error messages 0f13d65e13211a91ce077b4a09307e54e9113f38 Catalin(ux) M. BOIE 2015-09-08 04:59:02
Lots of bug fixes, especially for cache a34c707720da68378086f73f16dd25c5a1ca8072 Catalin(ux) M. BOIE 2015-09-07 06:06:46
Mostly TOTP stuff for ssh 90eed0aa343f735f717238e3937439737290ecfd Catalin(ux) M. BOIE 2015-08-28 04:51:12
Added TOTP feature and some other minor stuff e9197291380929dd53f02f7373e8a339d6bd65a2 Catalin(ux) M. BOIE 2015-08-23 12:07:44
TODO clean-up. 1ae7c17d523aec8e6a303264e2c35934c459fc9d Catalin(ux) M. BOIE 2015-07-14 20:27:45
duilder updates (error out if head is not a tag 09ff5d7b52d059a7fab09427d8e6d12319a53804 Catalin(ux) M. BOIE 2015-07-14 20:27:35
Bump version to 0.39 c28468b1cf0488f8f98b04aeb6ba26429ee91807 Catalin(ux) M. BOIE 2015-07-14 04:34:34
duilder updates cc12a3a5a95586b4533346ccf7fd4cfa652e7d6f Catalin(ux) M. BOIE 2015-07-14 04:34:09
Use _blank instead of _new for page loading 2afd660c2f3ded308e9f1e76c844dcdb60f20dec Catalin(ux) M. BOIE 2015-07-14 04:30:51
TODO stuff d46f377f74021db2581d96e27a4d9b76e2b12348 Catalin(ux) M. BOIE 2015-07-14 04:30:29
Really corrected repo.php unit test. 219a7061df42a1593fc0f3959eddc9a3d54496ab Catalin(ux) M. BOIE 2015-07-14 04:25:56
Corrected 'rights' unit test. b3657cb073291681e8e3fd6ec9523bf550081d8e Catalin(ux) M. BOIE 2015-07-14 04:14:48
Remove more junk from testing folder. 0e769caa8f59615804312c488b74683288243196 Catalin(ux) M. BOIE 2015-07-14 04:14:27
Bump version to 0.38 b5e57d1da1a8a4a207234e1de4dcc4b6cdbe56ed Catalin(ux) M. BOIE 2015-07-13 20:19:32
Fix the islands 4f5d52ff6f87bb1dc48003337d42a6e3a2d98711 Catalin(ux) M. BOIE 2015-07-13 20:18:53
Open my webpage in another tab 54bc4e25313e41a2c0c46f186dc44e9223b9e69e Catalin(ux) M. BOIE 2015-07-13 20:18:04
Switch to Affero GPLv3! eb00fa19c6d3db33cf93b89b35ff08cc41a0d620 Catalin(ux) M. BOIE 2015-07-13 15:54:53
TODO stuff. 1715e3f2a5f61fb9afa77bd0a8ffa9096248e5db Catalin(ux) M. BOIE 2015-07-13 15:50:11
Commit 621b0a317b65d9a751d221908b8e1664d96011fa - Fix repo stats when there is no commit inside.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-09-11 04:58
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-09-11 04:58
Parent(s): d8d06816223b52ff1d65df502fc6175f26c15518
Signing key:
Tree: 2ccee6c59ff694fe4b8f2040aaf2072d31c955a1
File Lines added Lines deleted
TODO 3 1
inc/git.inc.php 3 2
inc/repo.inc.php 24 13
root/themes/default/repo/stats/authors/nodata.html 0 1
root/themes/default/repo/stats/stats.html 3 0
tests/git.php 10 0
File TODO changed (mode: 100644) (index a6b74aa..0af8ec3)
1 1 == Where I stopped last time == == Where I stopped last time ==
2 [ ] Test with an empty commit what happens in rg_git_log with patches == TRUE.
3 2 [ ] [ ]
4 3
5 4 == BEFORE NEXT RELEASE == == BEFORE NEXT RELEASE ==
5 [ ] Test with an empty commit what happens in rg_git_log with patches == TRUE.
6 Can happen? Maybe for a rename?
7 [ ] Add repo stats to ssh repo command.
6 8 [ ] build rg_user_git_stats that will lookup email into stats and resolve them [ ] build rg_user_git_stats that will lookup email into stats and resolve them
7 9 to be rg links? to be rg links?
8 10 [ ] repo:stats: seems the number of commits is limited somehow! [ ] repo:stats: seems the number of commits is limited somehow!
File inc/git.inc.php changed (mode: 100644) (index 5b04442..8aa9f87)
... ... function rg_git_log($path, $max, $from, $to, $also_patch)
694 694 if (!file_exists($path . "/refs/heads/master")) { if (!file_exists($path . "/refs/heads/master")) {
695 695 if (!file_exists($path . "/.git/refs/heads/master")) { if (!file_exists($path . "/.git/refs/heads/master")) {
696 696 rg_log("Repo is empty."); rg_log("Repo is empty.");
697 $ret = array();
697 698 break; break;
698 699 } }
699 700 } }
 
... ... function rg_git_log($path, $max, $from, $to, $also_patch)
739 740 . $from_to; . $from_to;
740 741 $a = rg_exec($cmd); $a = rg_exec($cmd);
741 742 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
742 rg_git_set_error("error on log (" . $a['errmsg'] . ")");
743 rg_internal_error("Could not generate log.");
743 rg_internal_error("error on log (" . $a['errmsg'] . ")");
744 rg_git_set_error("could not generate log; try again later");
744 745 break; break;
745 746 } }
746 747
File inc/repo.inc.php changed (mode: 100644) (index c27873b..d97d4af)
... ... function rg_repo_discover($db, $op, $rg, $ui)
1732 1732 */ */
1733 1733 function rg_repo_stats($rg) function rg_repo_stats($rg)
1734 1734 { {
1735 if ($rg['ri']['git_dir_done'] == 0)
1736 return rg_template('repo/no_git_dir.html', $rg, TRUE /*xss*/);
1735 rg_log_enter('repo_start');
1737 1736
1738 $path = rg_repo_path_by_id($rg['ri']['uid'], $rg['ri']['repo_id']);
1739 $log = rg_git_log($path, 0 /*max*/, '', '', FALSE);
1740 if ($log === FALSE)
1741 return rg_template('internal_err.html', $rg, TRUE /*xss*/);
1737 while (1) {
1738 if ($rg['ri']['git_dir_done'] == 0) {
1739 $ret = rg_template('repo/no_git_dir.html', $rg, TRUE /*xss*/);
1740 break;
1741 }
1742
1743 $path = rg_repo_path_by_id($rg['ri']['uid'], $rg['ri']['repo_id']);
1744 $log = rg_git_log($path, 0 /*max*/, '', '', FALSE);
1745 if ($log === FALSE) {
1746 $ret = rg_template('internal_err.html', $rg, TRUE /*xss*/);
1747 break;
1748 }
1742 1749
1743 $s = rg_git_stats($log);
1744 // TODO: can this return error?
1745 rg_log_ml('DEBUG: stats: ' . print_r($s, TRUE));
1746 $rg['ri']['stats'] = $s['global'];
1750 $s = rg_git_stats($log);
1751 //rg_log_ml('DEBUG: stats: ' . print_r($s, TRUE));
1752 $rg['ri']['stats'] = $s['global'];
1747 1753
1748 $rg['ri']['HTML:authors'] = rg_template_table('repo/stats/authors',
1749 $s['authors'], $rg);
1754 $rg['ri']['HTML:authors'] = rg_template_table('repo/stats/authors',
1755 $s['authors'], $rg);
1750 1756
1751 return rg_template('repo/stats/stats.html', $rg, TRUE /*xss*/);
1757 $ret = rg_template('repo/stats/stats.html', $rg, TRUE /*xss*/);
1758 break;
1759 }
1760
1761 rg_log_exit();
1762 return $ret;
1752 1763 } }
1753 1764
1754 1765 ?> ?>
File root/themes/default/repo/stats/authors/nodata.html changed (mode: 100644) (index e25f181..e69de29)
1 y
File root/themes/default/repo/stats/stats.html changed (mode: 100644) (index 65dada6..c89d41f)
1 1 Added on this site on <b>@@ri::itime_nice@@</b>.<br /> Added on this site on <b>@@ri::itime_nice@@</b>.<br />
2 2 Disk space used: <b>@@ri::disk_used_mb@@ MiB</b>.<br /> Disk space used: <b>@@ri::disk_used_mb@@ MiB</b>.<br />
3 3 Bugs reported: <b>@@ri::last_bug_id@@</b>.<br /> Bugs reported: <b>@@ri::last_bug_id@@</b>.<br />
4
5 @@if("@@ri::stats::start_date@@" != ""){{
4 6 <br /> <br />
5 7 Project started on <b>@@ri::stats::start_date@@</b> by <b>@@ri::stats::start_author@@</b>.<br /> Project started on <b>@@ri::stats::start_date@@</b> by <b>@@ri::stats::start_author@@</b>.<br />
6 8 Last commit on <b>@@ri::stats::last_date@@</b> by <b>@@ri::stats::last_author@@</b>.<br /> Last commit on <b>@@ri::stats::last_date@@</b> by <b>@@ri::stats::last_author@@</b>.<br />
 
... ... Number of lines added: <b>@@ri::stats::lines_add@@</b>.<br />
9 11 Number of lines deleted: <b>@@ri::stats::lines_del@@</b>.<br /> Number of lines deleted: <b>@@ri::stats::lines_del@@</b>.<br />
10 12
11 13 @@ri::authors@@ @@ri::authors@@
14 }}
File tests/git.php changed (mode: 100644) (index ecef385..d8f39cd)
... ... $rg_no_db = TRUE;
13 13 require_once("common.php"); require_once("common.php");
14 14
15 15
16 rg_log('');
17 rg_log("Testing rg_git_log with a rename");
18 system("git init git_rename; cd git_rename;"
19 . " touch a; git add a; git commit -a -m \"aaa\";"
20 . " git mv a b; git commit -a -m \"bbb\"");
21 $r = rg_git_log('git_rename/.git', 1, '', '', TRUE);
22 // we do not test here nothing, we will let err- files "speak"
23 system("rm -rf git_rename");
24
25
16 26 rg_log(''); rg_log('');
17 27 rg_log("Testing rg_git_log for binary files"); rg_log("Testing rg_git_log for binary files");
18 28 system("git init git_bin; cd git_bin;" system("git init git_bin; cd git_bin;"
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