summaryrefslogtreecommitdiffstats
path: root/git2rss
diff options
context:
space:
mode:
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) {