This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  2248a91073a7b2f78c3dfdedb628617ec7dd2f23 (commit)
      from  85c188dcd9cb2727ce5636aa37de739140954254 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=2248a91073a7b2f78c3dfdedb628617ec7dd2f23

commit 2248a91073a7b2f78c3dfdedb628617ec7dd2f23
Author: Marc-Etienne Vargenau <[email protected]>
Date:   Wed Jun 15 17:01:22 2016 +0200

    Whitespace

diff --git a/src/plugins/scmgit/common/GitPlugin.class.php 
b/src/plugins/scmgit/common/GitPlugin.class.php
index f5c3625..7bb949c 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -74,7 +74,7 @@ control over it to the project's administrator.");
                        $result = db_query_params('SELECT sum(updates) AS 
updates, sum(adds) AS adds FROM stats_cvs_group WHERE group_id=$1',
                                                array($project->getID()));
                        $commit_num = db_result($result,0,'updates');
-                       $add_num = db_result($result,0,'adds');
+                       $add_num = db_result($result, 0, 'adds');
                        if (!$commit_num) {
                                $commit_num = 0;
                        }
@@ -355,16 +355,16 @@ control over it to the project's administrator.");
 
                if (db_numrows($result) > 0) {
                        $tableHeaders = array(
-                       _('Name'),
-                       _('Adds'),
-                       _('Updates')
+                                       _('Name'),
+                                       _('Adds'),
+                                       _('Updates')
                        );
                        $b .= $HTML->listTableTop($tableHeaders, false, '', 
'repo-history');
 
                        $i = 0;
                        $total = array('adds' => 0, 'updates' => 0);
 
-                       while($data = db_fetch_array($result)) {
+                       while ($data = db_fetch_array($result)) {
                                $cells = array();
                                $cells[] = 
array(util_make_link_u($data['user_name'], $data['user_id'], 
$data['realname']), 'class' => 'halfwidth');
                                $cells[] = array($data['adds'], 'class' => 
'onequarterwidth align-right');
@@ -499,14 +499,14 @@ control over it to the project's administrator.");
                                                  $this->getID()));
                $rows = db_numrows($result);
                for ($i=0; $i<$rows; $i++) {
-                       $repo_name = db_result($result,$i,'repo_name');
-                       $description = db_result($result,$i,'description');
-                       $clone_url = db_result($result,$i,'clone_url');
+                       $repo_name = db_result($result, $i, 'repo_name');
+                       $description = db_result($result, $i, 'description');
+                       $clone_url = db_result($result, $i, 'clone_url');
                        // Clone URLs need to be validated to prevent a 
potential arbitrary command execution
                        if (!preg_match('|^[-a-zA-Z0-9:./_]+$|', $clone_url)) {
                                $clone_url = '';
                        }
-                       $repodir = $root . '/' .  $repo_name . '.git';
+                       $repodir = $root . '/' . $repo_name . '.git';
                        if (!is_file("$repodir/HEAD") && 
!is_dir("$repodir/objects") && !is_dir("$repodir/refs")) {
                                if ($clone_url != '') {
                                        system("cd $root; LC_ALL=C git clone 
--quiet --bare $clone_url $repodir 2>&1 >/dev/null | grep -v 'warning: You 
appear to have cloned an empty repository.' >&2");
@@ -542,8 +542,8 @@ control over it to the project's administrator.");
                                                  $this->getID()));
                $rows = db_numrows ($result);
                for ($i=0; $i<$rows; $i++) {
-                       $repo_name = db_result($result,$i,'repo_name');
-                       $repodir = $root . '/' .  $repo_name . '.git';
+                       $repo_name = db_result($result, $i, 'repo_name');
+                       $repodir = $root . '/' . $repo_name . '.git';
                        if (util_is_valid_repository_name($repo_name)) {
                                system("rm -rf $repodir");
                        }
@@ -566,8 +566,8 @@ control over it to the project's administrator.");
                        system("chmod 00755 $root/users");
                }
                for ($i=0; $i<$rows; $i++) {
-                       $user_name = db_result($result,$i,'user_name');
-                       $repodir = $root . '/users/' .  $user_name . '.git';
+                       $user_name = db_result($result, $i, 'user_name');
+                       $repodir = $root . '/users/' . $user_name . '.git';
 
                        if (!is_dir($repodir) && mkdir ($repodir, 0700)) {
                                chown ($repodir, $user_name);
@@ -580,7 +580,7 @@ control over it to the project's administrator.");
                                $params['main_repo'] = $main_repo;
 
                                util_sudo_effective_user($user_name,
-                                                        
array("GitPlugin","createUserRepo"),
+                                                        array("GitPlugin", 
"createUserRepo"),
                                                         $params);
                        }
                }
@@ -681,12 +681,12 @@ control over it to the project's administrator.");
                        $start_time = gmmktime(0, 0, 0, $month, $day, $year);
                        $end_time = $start_time + 86400;
 
-                       $usr_adds    = array();
+                       $usr_adds = array();
                        $usr_updates = array();
                        $usr_deletes = array();
                        $usr_commits = array();
 
-                       $adds    = 0;
+                       $adds = 0;
                        $updates = 0;
                        $deletes = 0;
                        $commits = 0;
@@ -708,7 +708,7 @@ control over it to the project's administrator.");
                                                array($month_string,
                                                       $day,
                                                       $project->getID()));
-                       if(!$res) {
+                       if (!$res) {
                                echo "Error while cleaning stats_cvs_group\n";
                                db_rollback();
                                return false;
@@ -724,7 +724,7 @@ control over it to the project's administrator.");
                                return false ;
                        }
 
-                       $last_user    = "";
+                       $last_user = "";
                        while (!feof($pipe) && $data = fgets($pipe)) {
                                $line = trim($data);
                                // Replace bad UTF-8 with '?' - it's quite hard 
to make git output non-UTF-8
@@ -748,11 +748,16 @@ control over it to the project's administrator.");
                                        } else {
                                                // Short-commit stats line
                                                $result = 
preg_match("/^(?P<mode>[AMD])\s+(?P<file>.+)$/", $line, $matches);
-                                               if (!$result) continue;
-                                               if ($last_user == "") continue;
-                                               if 
(!isset($usr_adds[$last_user])) $usr_adds[$last_user] = 0;
-                                               if 
(!isset($usr_updates[$last_user])) $usr_updates[$last_user] = 0;
-                                               if 
(!isset($usr_deletes[$last_user])) $usr_deletes[$last_user] = 0;
+                                               if (!$result)
+                                                       continue;
+                                               if ($last_user == "")
+                                                       continue;
+                                               if 
(!isset($usr_adds[$last_user]))
+                                                       $usr_adds[$last_user] = 
0;
+                                               if 
(!isset($usr_updates[$last_user]))
+                                                       
$usr_updates[$last_user] = 0;
+                                               if 
(!isset($usr_deletes[$last_user]))
+                                                       
$usr_deletes[$last_user] = 0;
                                                if ($matches['mode'] == 'A') {
                                                        $usr_adds[$last_user]++;
                                                        $adds++;
@@ -785,7 +790,7 @@ control over it to the project's administrator.");
                        }
 
                        // building the user list
-                       $user_list = array_unique( array_merge( array_keys( 
$usr_adds ), array_keys( $usr_updates ), array_keys( $usr_deletes ), 
array_keys( $usr_commits ) ) );
+                       $user_list = 
array_unique(array_merge(array_keys($usr_adds), array_keys($usr_updates), 
array_keys($usr_deletes), array_keys($usr_commits)));
 
                        foreach ($user_list as $user) {
                                // Trying to get user id from user name or email
@@ -793,10 +798,10 @@ control over it to the project's administrator.");
                                if ($u) {
                                        $user_id = $u->getID();
                                } else {
-                                       $res=db_query_params('SELECT user_id 
FROM users WHERE lower(realname)=$1 OR lower(email)=$2',
+                                       $res = db_query_params('SELECT user_id 
FROM users WHERE lower(realname)=$1 OR lower(email)=$2',
                                                array(strtolower($user), 
strtolower($user2email[$user])));
                                        if ($res && db_numrows($res) > 0) {
-                                               $user_id = 
db_result($res,0,'user_id');
+                                               $user_id = db_result($res, 0, 
'user_id');
                                        } else {
                                                continue;
                                        }
@@ -859,7 +864,7 @@ control over it to the project's administrator.");
 
                // TODO: ideally we generate one snapshot per git repository
                $toprepo = forge_get_config('repos_path', 'scmgit');
-               $repo = $toprepo . '/' . $project->getUnixName() . '/' .  
$project->getUnixName() . '.git';
+               $repo = $toprepo . '/' . $project->getUnixName() . '/' . 
$project->getUnixName() . '.git';
 
                if (!is_dir($repo)) {
                        if (is_file($snapshot)) {
@@ -899,6 +904,7 @@ control over it to the project's administrator.");
 
        /**
         * widgets - 'widgets' hook handler
+        *
         * @param array $params
         * @return boolean
         */
@@ -915,6 +921,7 @@ control over it to the project's administrator.");
 
        /**
         * Process the 'widget_instance' hook to create instances of the widgets
+        *
         * @param array $params
         */
        function myPageBox($params) {
@@ -948,7 +955,7 @@ control over it to the project's administrator.");
                        }
 
                        $project_name = $project->getUnixName();
-                       $repo = forge_get_config('repos_path', 'scmgit') . '/' 
. $project_name . '/' . $project_name .'.git';
+                       $repo = forge_get_config('repos_path', 'scmgit') . '/' 
. $project_name . '/' . $project_name . '.git';
                        if (is_dir($repo)) {
                                chdir($repo);
                                $params['output'] .= $project_name.': '.`git gc 
--quiet 2>&1`;

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/scmgit/common/GitPlugin.class.php | 63 +++++++++++++++------------
 1 file changed, 35 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to