summaryrefslogtreecommitdiffstats
path: root/git2rss
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-03-28 11:03:13 +0200
committerRemi Collet <fedora@famillecollet.com>2017-03-28 11:03:13 +0200
commit5c16fe724369a520077ea311fb1228a4a472af6f (patch)
tree85d435b3a220f39afa1e425eb85b0ff329c0c4c2 /git2rss
parent4b1d2f419615dd53193ed85a05d6e519b988c572 (diff)
swap order
Diffstat (limited to 'git2rss')
-rwxr-xr-xgit2rss18
1 files changed, 9 insertions, 9 deletions
diff --git a/git2rss b/git2rss
index 76b7a13..98e7c2d 100755
--- a/git2rss
+++ b/git2rss
@@ -23,15 +23,6 @@ use Suin\RSSWriter\Channel;
use Suin\RSSWriter\Feed;
use Suin\RSSWriter\Item;
-// Load previous changes
-if (file_exists(__DIR__ . '/git2rss.json')) {
- $json = file_get_contents(__DIR__ . '/git2rss.json');
- $histo = json_decode($json, true);
- printf("RSS %d entries loaded\n", count($histo));
-} else {
- $histo = array();
-}
-
// Current change
exec('git log --format=fuller -1', $out);
$log = exec("git log --pretty=format:%H,%at,%cn,%an,%s -1");
@@ -56,6 +47,15 @@ $short = substr($entry['hash'], 0, 7);
printf("Welcome %s\n", $entry['commiter']);
echo "RSS new entry: ${entry['author']} pushed to ${entry['repo']} (${entry['head']},$short): ${entry['comment']}\n";
+// Load previous changes
+if (file_exists(__DIR__ . '/git2rss.json')) {
+ $json = file_get_contents(__DIR__ . '/git2rss.json');
+ $histo = json_decode($json, true);
+ printf("RSS %d entries loaded\n", count($histo));
+} else {
+ $histo = array();
+}
+
// 50 recent changes, and save
$histo = array_merge([$entry], $histo);
while (count($histo) > FEEDSIZE) {