Last active
December 11, 2015 23:48
Revisions
-
joaoneto revised this gist
Jun 22, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ * To use, set executable permissions to this file and execute: * $ php changelog.php > CHANGELOG.md * * Copyright (c) 2014 João Pinto Neto * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php * * @@ -21,7 +21,7 @@ if (!isset($result[$match[1]])) { $result[$match[1]] = array(); } $result[$match[1]][] = $match[4] . ' (by ' . $match[2] . ' '. $match[3] . ')'; } } -
joaoneto revised this gist
Feb 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ * This is a script to transform GIT LOG into a cute format Changelog.md * * To use, set executable permissions to this file and execute: * $ php changelog.php > CHANGELOG.md * * Copyright (c) 2013 João Pinto Neto * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php -
joaoneto revised this gist
Jan 31, 2013 . No changes.There are no files selected for viewing
-
joaoneto created this gist
Jan 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ <?php /** * Changelog Markdown * * This is a script to transform GIT LOG into a cute format Changelog.md * * To use, set executable permissions to this file and execute: * $ php changelog.php > CHANGELOG.mg * * Copyright (c) 2013 João Pinto Neto * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php * * */ $cmd = 'git log --pretty="%ad: [%an] <%ae> %s" --date="short" --no-merges'; $process = shell_exec($cmd); $result = array(); foreach (preg_split("/((\r?\n)|(\r\n?))/", $process) as $line) { if (preg_match('/(^\d{4}-\d{2}-\d{2})\:\s\[(.*)\]\s(\<.*\>)\s(.*)/', $line, $match)) { if (!isset($result[$match[1]])) { $result[$match[1]] = array(); } $result[$match[1]][] = $match[4]; } } echo '# Changelog' . PHP_EOL; foreach ($result as $date => $data) { echo '## ' . $date . PHP_EOL; foreach ($data as $change) { echo '- ' . $change . PHP_EOL; } echo PHP_EOL; }