[Bps-public-commit] App-Changeloggr branch, master, updated. 36ab0faa6cb6c4a1640810b8d0028c80c1eb8847

sartak at bestpractical.com sartak at bestpractical.com
Mon Mar 30 14:05:46 EDT 2009


The branch, master has been updated
       via  36ab0faa6cb6c4a1640810b8d0028c80c1eb8847 (commit)
      from  e14a227ef08339550017e22227bfbee1188a2d29 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/ChangeCollection.pm |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 36ab0faa6cb6c4a1640810b8d0028c80c1eb8847
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Mar 30 14:05:31 2009 -0400

    Steal App-Changelogger's git entry parsing code

diff --git a/lib/App/Changeloggr/Model/ChangeCollection.pm b/lib/App/Changeloggr/Model/ChangeCollection.pm
index bb39cf6..3356296 100644
--- a/lib/App/Changeloggr/Model/ChangeCollection.pm
+++ b/lib/App/Changeloggr/Model/ChangeCollection.pm
@@ -65,6 +65,29 @@ sub extract_change_data_from_git {
         or return;
     my %fields;
 
+    if ($entry =~ /^commit (.*)$/im) {
+        $fields{commit_id} = $1;
+    }
+    if ($entry =~ /^Author:\s*(.*)$/im) {
+        $fields{author} = $1;
+    }
+    if ($entry =~ /^(?:Author)?Date:\s*(.*)$/im) {
+        $fields{date} = $1;
+    }
+    if ($entry =~ /^Commit:\s*(.*)$/im) {
+        $fields{commit} = $1;
+    }
+    if ($entry =~ /^CommitDate:\s*(.*)$/im) {
+        $fields{commit_date} = $1;
+    }
+
+    if ($entry =~ /.*?^(\s{4}.*?)(^\s{1,2}\S+\s+\|\s+\d+|\z)/ims) {
+        $fields{msg} = $1;
+    }
+    if ($entry =~ /\n(\s{1,2}\S+\s+\|\s+\d+.*)$/ims) {
+        $fields{changed_files} = $1;
+    }
+
     return (\%fields, $text);
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list