<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>src/CommitRenderer.mxml</filename>
    </added>
    <added>
      <filename>src/LogView.mxml</filename>
    </added>
    <added>
      <filename>src/chacon/git/AsGitAuthor.as</filename>
    </added>
    <added>
      <filename>src/chacon/git/AsGitCommit.as</filename>
    </added>
    <added>
      <filename>src/chacon/git/AsGitObject.as</filename>
    </added>
    <added>
      <filename>src/chacon/utils/Callback.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/crypto/MD5.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/crypto/SHA1.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/crypto/SHA224.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/crypto/SHA256.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/crypto/WSSEUsernameToken.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/errors/IllegalStateError.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/fileformats/vcard/Address.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/fileformats/vcard/Email.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/fileformats/vcard/Phone.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/fileformats/vcard/VCard.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/fileformats/vcard/VCardParser.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/images/BitString.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/images/JPGEncoder.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/images/PNGEncoder.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/DynamicURLLoader.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/IURIResolver.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/MimeTypeMap.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/URI.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/URIEncodingBitmap.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/net/proxies/RFC2817Socket.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSON.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONDecoder.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONEncoder.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONParseError.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONToken.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONTokenType.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/serialization/json/JSONTokenizer.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/ArrayUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/DateUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/DictionaryUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/IntUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/NumberFormatter.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/StringUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/utils/XMLUtil.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/webapis/ServiceBase.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/webapis/URLLoaderBase.as</filename>
    </added>
    <added>
      <filename>src/com/adobe/webapis/events/ServiceEvent.as</filename>
    </added>
    <added>
      <filename>src/img/.DS_Store</filename>
    </added>
    <added>
      <filename>src/img/user.jpg</filename>
    </added>
    <added>
      <filename>src/style.css</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff></diff>
      <filename>bin-debug/Git.swf</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,103 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
 &lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
-	 layout=&quot;absolute&quot; width=&quot;800&quot; height=&quot;600&quot; initialize=&quot;initApp();&quot;&gt;
+	 layout=&quot;absolute&quot; width=&quot;800&quot; height=&quot;600&quot; initialize=&quot;initApp()&quot;
+	 verticalScrollPolicy=&quot;off&quot;
+	 horizontalScrollPolicy=&quot;off&quot;&gt;
+	 
+	&lt;mx:Style source=&quot;style.css&quot;/&gt;
+	 
 	&lt;mx:Script&gt;
 		&lt;![CDATA[
-		
+			import mx.core.UIComponent;
+			import mx.controls.Image;
+			import mx.collections.ArrayCollection;			
+			import chacon.utils.ByteArrayPack;
+			import chacon.git.*;
+			
 		// TODO :
 		// * browse
+		// * clear icon cache button
+		// * deal with pack files
+		// * cache trees and commits in sqlite
+		//
+		// * init
 		// * clone
 		// * add
 		// * commit 
 		
-			import chacon.utils.ByteArrayPack;
-			import chacon.git.AsGit;
-			
 			private var git:AsGit;
+			private var gitDir:String;
 			
 			public function initApp():void {
-				git = new AsGit('/Users/schacon/projects/simplegit');
-				showHead();
+				changeGitPath('/Users/schacon/projects/simplegit');
+			}
+			
+			public function changeGitPath(path:String):void {
+				var dir:String = path;				
+				git = new AsGit(dir);
+				gitDir = dir;
 			}
 			
-			public function showHead():void {
-				output.text = git.readObject(git.readGitFile(git.headRef()));
+			public function initLogs():void {
+				switchDir.label = gitDir;
+				//tree.directory = new File(dir);
+				fillLog();				
 			}
 			
-			public function runHex():void {
-				// define the ByteArray
-				var bytes:ByteArray = new ByteArray();
-				bytes.writeMultiByte(input.text, 'iso-8859-1');
-				trace(&quot;bytes length is: &quot; +  bytes.length);    // display the length
-				var packHex:ByteArray = ByteArrayPack.packHex(bytes);
-				output.text = packHex.toString();
-				bytes = ByteArrayPack.unpackHex(packHex);
-				output2.text = bytes.toString();
+			public function fillLog():void {
+				var logArr:Array = git.log();
+				log.dataProvider = new ArrayCollection(logArr.reverse());
 			}
+						
+			public function switchDirectories():void {
+				viewstack.selectedIndex = 1;
+			}
+			
+			public function trySwitch():void {
+				var path:String = tree.selectedPath;
+				trace(path);
+				var selectPath:File = new File(path);
+				if(selectPath.isDirectory) {
+					if(selectPath.resolvePath('.git').exists) {
+						changeGitPath(path);
+						initLogs();
+						viewstack.selectedIndex = 0;
+					}
+				}
+			}
+			
+			public function showLog():void {
+				output.text = log.selectedItem.raw;
+				output.text += git.readObject(log.selectedItem.parents[0]).raw;
+			}
+			
 		]]&gt;
 	&lt;/mx:Script&gt;
-	&lt;mx:Text id=&quot;output&quot; x=&quot;183&quot; y=&quot;107&quot; text=&quot;f2&quot;/&gt;
+    
+	&lt;mx:ViewStack x=&quot;0&quot; y=&quot;0&quot; id=&quot;viewstack&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+
+		&lt;mx:VBox height=&quot;100%&quot; width=&quot;100%&quot; initialize=&quot;initLogs()&quot;
+			paddingLeft=&quot;10&quot; paddingRight=&quot;10&quot; paddingTop=&quot;10&quot; paddingBottom=&quot;10&quot;&gt;
+			&lt;mx:HBox width=&quot;100%&quot; height=&quot;30&quot;&gt;
+				&lt;mx:Image source=&quot;/img/git-logo.png&quot;/&gt;
+				&lt;mx:Button id=&quot;switchDir&quot; click=&quot;switchDirectories()&quot; label=&quot;Choose Directory&quot;/&gt;
+				&lt;mx:Spacer width=&quot;100%&quot;/&gt;
+				&lt;mx:Text text=&quot;Branch:&quot;/&gt;
+				&lt;mx:ComboBox&gt;&lt;/mx:ComboBox&gt;			
+			&lt;/mx:HBox&gt;	
+			&lt;mx:HBox width=&quot;100%&quot; height=&quot;100%&quot;&gt;	
+				&lt;mx:List id=&quot;log&quot; width=&quot;250&quot; height=&quot;100%&quot; click=&quot;showLog()&quot; itemRenderer=&quot;CommitRenderer&quot;/&gt;
+				&lt;mx:Text id=&quot;output&quot; text=&quot;output&quot; width=&quot;100%&quot; height=&quot;100%&quot;/&gt;
+			&lt;/mx:HBox&gt;
+		&lt;/mx:VBox&gt;
+
+		&lt;mx:TitleWindow id=&quot;dirChooser&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+		 	&lt;mx:VBox  width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+				&lt;mx:FileSystemTree id=&quot;tree&quot; width=&quot;100%&quot; height=&quot;100%&quot;/&gt;	
+				&lt;mx:Button id=&quot;chooseDir&quot; click=&quot;trySwitch()&quot; label=&quot;Choose Directory&quot;/&gt;				
+			&lt;/mx:VBox&gt;
+		&lt;/mx:TitleWindow&gt;
+	
+	&lt;/mx:ViewStack&gt;
 	
 &lt;/mx:WindowedApplication&gt;</diff>
      <filename>src/Git.mxml</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 package chacon.git
 {
 	import chacon.utils.ByteArrayPack;
+	import chacon.git.*;
 	import flash.filesystem.File;
 	import flash.filesystem.FileStream;
 	import flash.filesystem.FileMode;
@@ -15,11 +16,23 @@ package chacon.git
 			gitDirectory = gitRepoDirectory + '/.git'
 		}
 		
-		public function readObject(sha:String):String {
+		public function log():Array {
+			var commit:AsGitCommit;
+			var sha:String = readGitFile(headRef());
+			
+			var arrCommits:Array = new Array;
+			while(sha) {
+				commit = readObject(sha) as AsGitCommit;
+				arrCommits.unshift(commit);
+				sha = commit.parents[0];
+			}
+			return arrCommits; 
+		}
+		
+		public function readObject(sha:String):Object {
 			sha = sha.substr(0, 40);
 			var dir:String = sha.substr(0,2);
 			var fname:String = sha.substr(2);
-			trace('objects/' + dir + '/' + fname);
 			var commit:ByteArray = readObjectBytes('objects/' + dir + '/' + fname);
 			commit.uncompress();
 			
@@ -41,9 +54,14 @@ package chacon.git
 					}
 				}
 			}
-			trace(header);
-			trace(body);
-			return body.toString();
+			
+			var arrHeader:Array = header.toString().split(' ');
+			if(arrHeader[0] == 'commit') {
+				var object:AsGitCommit = new AsGitCommit(sha, body.toString(), arrHeader[1]);
+				return object;
+			}
+
+			return new AsGitObject;
 		}
 		
 		public function readObjectBytes(file:String):ByteArray {</diff>
      <filename>src/chacon/git/AsGit.as</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e1ed7683c0a3ebb5d495a3356defa9b973c9940</id>
    </parent>
  </parents>
  <author>
    <name>Scott Chacon</name>
    <email>schacon@gmail.com</email>
  </author>
  <url>http://github.com/schacon/asgit/commit/711c3bd72f9bd4fe3e8de9360ed94a076c5806d1</url>
  <id>711c3bd72f9bd4fe3e8de9360ed94a076c5806d1</id>
  <committed-date>2008-05-27T22:11:12-07:00</committed-date>
  <authored-date>2008-05-27T22:11:12-07:00</authored-date>
  <message>added adobe libraries and bunches of changes</message>
  <tree>fdd13476d91a6b9caa9f2d5dda7cd6775301aa2b</tree>
  <committer>
    <name>Scott Chacon</name>
    <email>schacon@gmail.com</email>
  </committer>
</commit>
