projects
/
web.mtrack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a6612b0
)
Fix #5661 - MTrack - daily email large and no branch
author
Alan Knowles
<alan@roojs.com>
Tue, 15 Jan 2019 10:18:39 +0000
(18:18 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 15 Jan 2019 10:18:39 +0000
(18:18 +0800)
MTrack/CommitChecker.php
patch
|
blob
|
history
MTrack/SCM.php
patch
|
blob
|
history
MTrack/SCM/Git/CommitHookBridge.php
patch
|
blob
|
history
MTrack/SCM/Git/Event.php
patch
|
blob
|
history
MTrack/SCM/Git/Repo.php
patch
|
blob
|
history
diff --git
a/MTrack/CommitChecker.php
b/MTrack/CommitChecker.php
index
1924c50
..
e1c2091
100644
(file)
--- a/
MTrack/CommitChecker.php
+++ b/
MTrack/CommitChecker.php
@@
-196,6
+196,7
@@
class MTrack_CommitChecker {
$c->changelog = $bridge->getCommitMessage();
$c->changeby = $this->authUser->email; //???
$c->changeby_id = $this->authUser->id; //???
$c->changelog = $bridge->getCommitMessage();
$c->changeby = $this->authUser->email; //???
$c->changeby_id = $this->authUser->id; //???
+ $c->branch = $bridge->branch;
//print_r($bridge);exit;
$c->ctime = isset($bridge->props['Date']) ? strtotime($bridge->props['Date']) : time();
$c->fileActions = $bridge->fileActions;
//print_r($bridge);exit;
$c->ctime = isset($bridge->props['Date']) ? strtotime($bridge->props['Date']) : time();
$c->fileActions = $bridge->fileActions;
diff --git
a/MTrack/SCM.php
b/MTrack/SCM.php
index
817a1af
..
e824403
100644
(file)
--- a/
MTrack/SCM.php
+++ b/
MTrack/SCM.php
@@
-264,11
+264,11
@@
abstract class MTrackSCM
public function resolveRevision($rev, $object, $ident)
{
if ($rev !== null) {
public function resolveRevision($rev, $object, $ident)
{
if ($rev !== null) {
- return $rev;
+
return $rev;
}
if ($object === null) {
}
if ($object === null) {
- return null;
+
return null;
}
switch ($object) {
}
switch ($object) {
diff --git
a/MTrack/SCM/Git/CommitHookBridge.php
b/MTrack/SCM/Git/CommitHookBridge.php
index
b16178c
..
2c5dee2
100644
(file)
--- a/
MTrack/SCM/Git/CommitHookBridge.php
+++ b/
MTrack/SCM/Git/CommitHookBridge.php
@@
-9,7
+9,7
@@
class MTrack_SCM_Git_CommitHookBridge extends IMTrackCommitHookBridge
{
var $repo;
{
var $repo;
-
+ var $branch = "";
var $files = array();
var $log = array();
var $commits = array();
var $files = array();
var $log = array();
var $commits = array();
@@
-26,6
+26,7
@@
class MTrack_SCM_Git_CommitHookBridge extends IMTrackCommitHookBridge
while (($line = fgets(STDIN)) !== false) {
echo "got: $line\n";
list($old, $new, $ref) = explode(' ', trim($line), 3);
while (($line = fgets(STDIN)) !== false) {
echo "got: $line\n";
list($old, $new, $ref) = explode(' ', trim($line), 3);
+ $this->branch = $ref;
$this->commits[] = $new;
if (preg_match('/^0+$/',$old)) {
$this->commits[] = $new;
if (preg_match('/^0+$/',$old)) {
diff --git
a/MTrack/SCM/Git/Event.php
b/MTrack/SCM/Git/Event.php
index
41406c0
..
a6a2a68
100644
(file)
--- a/
MTrack/SCM/Git/Event.php
+++ b/
MTrack/SCM/Git/Event.php
@@
-13,7
+13,9
@@
class MTrack_SCM_Git_Event extends MTrackSCMEvent
/** who committed this revision */
public $changeby;
/** who committed this revision */
public $changeby;
-
+
+ /** branch for this revision */
+ public $branch;
/** when this revision was committed */
public $ctime;
/** when this revision was committed */
public $ctime;
@@
-34,12
+36,11
@@
class MTrack_SCM_Git_Event extends MTrackSCMEvent
$lines = explode("\n", $commit);
$line = array_shift($lines);
$lines = explode("\n", $commit);
$line = array_shift($lines);
- if (!preg_match("/^commit\s+(\S+)$/", $line, $M)) {
+ if (!preg_match("/^commit\s+(\S+)
\s+(\S+)
$/", $line, $M)) {
return false;
}
$ent->rev = $M[1];
return false;
}
$ent->rev = $M[1];
-
- $ent->branches = array(); // FIXME
+ $ent->branch = $M[2] ;
$ent->tags = array(); // FIXME
$ent->files = array();
$ent->tags = array(); // FIXME
$ent->files = array();
@@
-116,7
+117,7
@@
class MTrack_SCM_Git_Event extends MTrackSCMEvent
}
// fixme..
if (!count($ent->branches)) {
}
// fixme..
if (!count($ent->branches)) {
- $ent->branches[] = 'master';
+ $ent->branches[] =
$this->branch; //
'master';
}
$ent->files_array = array_values($ent->files);
return $ent;
}
$ent->files_array = array_values($ent->files);
return $ent;
diff --git
a/MTrack/SCM/Git/Repo.php
b/MTrack/SCM/Git/Repo.php
index
3c777e9
..
402e45a
100644
(file)
--- a/
MTrack/SCM/Git/Repo.php
+++ b/
MTrack/SCM/Git/Repo.php
@@
-271,6
+271,7
@@
HOOK;
$args[] = "--no-abbrev";
$args[] = "--numstat";
$args[] = "--date=rfc";
$args[] = "--no-abbrev";
$args[] = "--numstat";
$args[] = "--date=rfc";
+ $args[] = "--source"; // show the branch..
//echo '<PRE>';print_r($args);echo '</PRE>';
//echo '<PRE>';print_r($args);echo '</PRE>';
@@
-285,7
+286,7
@@
HOOK;
$commit = null;
while (true) {
$line = fgets($fp);
$commit = null;
while (true) {
$line = fgets($fp);
- if ($line === false) {
+ if ($line === false) {
//end of file..
if ($commit !== null) {
$commits[] = $commit;
}
if ($commit !== null) {
$commits[] = $commit;
}