diff options
author | Remi Collet <fedora@famillecollet.com> | 2017-03-28 11:03:13 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2017-03-28 11:03:13 +0200 |
commit | 5c16fe724369a520077ea311fb1228a4a472af6f (patch) | |
tree | 85d435b3a220f39afa1e425eb85b0ff329c0c4c2 /git2rss | |
parent | 4b1d2f419615dd53193ed85a05d6e519b988c572 (diff) |
swap order
Diffstat (limited to 'git2rss')
-rwxr-xr-x | git2rss | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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) { |