<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,2 @@
 nbproject
-user-history
+user-history*</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,7 @@ history = File.open(&quot;user-history.log&quot;, &quot;w&quot;)
 # A tests/bug_curb_easy_blocks_ruby_threads.rb
 # D ext/ectconf_old.rb
 
+user_commits = []
 userdata[&quot;repositories&quot;].each do |repo|
 
   repodata = JSON.parse(open(&quot;http://github.com/api/v1/json/#{username}/#{repo[&quot;name&quot;]}/commits/master&quot;).read)
@@ -56,41 +57,47 @@ userdata[&quot;repositories&quot;].each do |repo|
     next if commit[&quot;committer&quot;][&quot;email&quot;] != userdata[&quot;email&quot;]
 
     puts &quot;#{repo[&quot;name&quot;]}: #{commit[&quot;id&quot;]}&quot;
+    commitdata = JSON.parse(open(&quot;http://github.com/api/v1/json/#{username}/#{repo[&quot;name&quot;]}/commit/#{commit[&quot;id&quot;]}&quot;).read)[&quot;commit&quot;]
+    
+    commit[&quot;committed_date&quot;] = DateTime.parse(commit[&quot;committed_date&quot;])
+    commit[&quot;details&quot;] = commitdata
 
-    history.write(&quot;\n\n------------------------------------------------------------------------\n&quot;)
-    history.write(&quot;r#{commit[&quot;id&quot;][0,7]} | #{commit[&quot;committer&quot;][&quot;email&quot;]} | &quot;)
-    history.write(&quot;#{DateTime.parse(commit[&quot;committed_date&quot;]).strftime(&quot;%Y-%m-%d %H:%M:%S %Z&quot;)} &quot;)
-    history.write(&quot;(#{DateTime.parse(commit[&quot;committed_date&quot;]).to_rfc2822}) | &quot;)
-    history.write(&quot;x lines\n&quot;)
-    history.write(&quot;Changed paths:&quot;)
+    user_commits.push commit
+  end
+end
 
-    commitdata = JSON.parse(open(&quot;http://github.com/api/v1/json/#{username}/#{repo[&quot;name&quot;]}/commit/#{commit[&quot;id&quot;]}&quot;).read)[&quot;commit&quot;]
+user_commits.sort_by {|c| c[&quot;committed_date&quot;]}
+user_commits.each do |commit|
 
-    # Sample commit drilldown from API (JSON):
-    # {
-    #     {&quot;removed&quot;: [{&quot;filename&quot;: &quot;commands.rb&quot;}, {&quot;filename&quot;: &quot;helpers.rb&quot;}],
-    #     &quot;added&quot;: [{&quot;filename&quot;: &quot;commands/commands.rb&quot;}, {&quot;filename&quot;: &quot;commands/helpers.rb&quot;}],
-    #     &quot;message&quot;: &quot;move commands.rb and helpers.rb into commands/ dir&quot;,
-    #     &quot;modified&quot;: [{&quot;diff&quot;: &quot;@@ -56,7 +56,7 @@ ...&quot;}],
-    #     &quot;parents&quot;: [{&quot;id&quot;: &quot;d462d2a2e60438ded3dd9e8e6593ca4146c5a0ba&quot;}],
-    #     &quot;url&quot;: &quot;http://github.com/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b&quot;,
-    #     &quot;author&quot;: {&quot;name&quot;: &quot;Chris Wanstrath&quot;, &quot;email&quot;: &quot;chris@ozmm.org&quot;},
-    #     &quot;id&quot;: &quot;c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b&quot;,
-    #     &quot;committed_date&quot;: &quot;2008-03-02T16:45:41-08:00&quot;,
-    #     &quot;authored_date&quot;: &quot;2008-03-02T16:45:41-08:00&quot;,
-    #     &quot;tree&quot;: &quot;28a1a1ca3e663d35ba8bf07d3f1781af71359b76&quot;,
-    #     &quot;committer&quot;: {&quot;name&quot;: &quot;Chris Wanstrath&quot;, &quot;email&quot;: &quot;chris@ozmm.org&quot;}}}
-    # }
-
-    %w(added removed modified).each do |action|
-      commitdata[action].each do |file|
-        history.write(&quot;\n#{action[0,1].capitalize} #{file[&quot;filename&quot;]}&quot;)
-      end
-    end
+  history.write(&quot;\n\n------------------------------------------------------------------------\n&quot;)
+  history.write(&quot;r#{commit[&quot;id&quot;][0,7]} | #{commit[&quot;committer&quot;][&quot;email&quot;]} | &quot;)
+  history.write(&quot;#{commit[&quot;committed_date&quot;].strftime(&quot;%Y-%m-%d %H:%M:%S %Z&quot;)} &quot;)
+  history.write(&quot;(#{commit[&quot;committed_date&quot;].to_rfc2822}) | &quot;)
+  history.write(&quot;x lines\n&quot;)
+  history.write(&quot;Changed paths:&quot;)
 
-  end
- 
-  # convert git logs to code_swarm XML format (make sure codeswarm/bin is in your path)
-  `#{codeswarm_path}/bin/convert_logs.py -g user-history.log -o user-history.log.xml`
+  # Sample commit drilldown from API (JSON):
+  # {
+  #     {&quot;removed&quot;: [{&quot;filename&quot;: &quot;commands.rb&quot;}, {&quot;filename&quot;: &quot;helpers.rb&quot;}],
+  #     &quot;added&quot;: [{&quot;filename&quot;: &quot;commands/commands.rb&quot;}, {&quot;filename&quot;: &quot;commands/helpers.rb&quot;}],
+  #     &quot;message&quot;: &quot;move commands.rb and helpers.rb into commands/ dir&quot;,
+  #     &quot;modified&quot;: [{&quot;diff&quot;: &quot;@@ -56,7 +56,7 @@ ...&quot;}],
+  #     &quot;parents&quot;: [{&quot;id&quot;: &quot;d462d2a2e60438ded3dd9e8e6593ca4146c5a0ba&quot;}],
+  #     &quot;url&quot;: &quot;http://github.com/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b&quot;,
+  #     &quot;author&quot;: {&quot;name&quot;: &quot;Chris Wanstrath&quot;, &quot;email&quot;: &quot;chris@ozmm.org&quot;},
+  #     &quot;id&quot;: &quot;c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b&quot;,
+  #     &quot;committed_date&quot;: &quot;2008-03-02T16:45:41-08:00&quot;,
+  #     &quot;authored_date&quot;: &quot;2008-03-02T16:45:41-08:00&quot;,
+  #     &quot;tree&quot;: &quot;28a1a1ca3e663d35ba8bf07d3f1781af71359b76&quot;,
+  #     &quot;committer&quot;: {&quot;name&quot;: &quot;Chris Wanstrath&quot;, &quot;email&quot;: &quot;chris@ozmm.org&quot;}}}
+  # }
 
+  %w(added removed modified).each do |action|
+    commit[&quot;details&quot;][action].each do |file|
+      history.write(&quot;\n#{action[0,1].capitalize} #{file[&quot;filename&quot;]}&quot;)
+    end
+  end
 end
+
+# convert git logs to code_swarm XML format (make sure codeswarm/bin is in your path)
+`#{codeswarm_path}/bin/convert_logs.py -g user-history.log -o user-history.log.xml`</diff>
      <filename>gitter.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f0d98bd84480075d32a96fd4dad9d462416c5618</id>
    </parent>
  </parents>
  <author>
    <name>Ilya Grigorik</name>
    <email>ilya@igvita.com</email>
  </author>
  <url>http://github.com/igrigorik/gitter/commit/4aa9d6aff1dc4d816f5e10df8fae2e3c966972fe</url>
  <id>4aa9d6aff1dc4d816f5e10df8fae2e3c966972fe</id>
  <committed-date>2009-01-22T21:23:08-08:00</committed-date>
  <authored-date>2009-01-22T21:23:08-08:00</authored-date>
  <message>sort user commits across all projects</message>
  <tree>c5c3a70f092f4b624f4093e7b66bb6cf3a0b9b32</tree>
  <committer>
    <name>Ilya Grigorik</name>
    <email>ilya@igvita.com</email>
  </committer>
</commit>
