First Working Version of CryptoQuip in Cocoa
I just got my Cocoa version of my CryptoQuip code working, and I have to say, I'm impressed - but then I knew I'd be. I can solve the standard puzzle in about 0.21 sec on my MacBook Pro - which is pretty darn speedy. I'm not completely happy with the results, as I think there are a ton of improvements I can make in the attack, and now that I have a really nice domain model, I can make these changes very easily. It's sweet.
I also decided to use git as the source control - and it was a little bit of a debate within myself on this issue. I'm normally a CVS guy, and I've gotten very good at making CVS do all that I've ever needed. But I don't have tethering on my iPhone, and at the prices AT&T are talking about, I'm not sure I will for a while. Still, I wanted to have it in source control, so git was it. Plus, it's clean, fast, local, and with Time Machine, it's as safe locally as it can possibly be.
Still, I'll probably put it up on my home git server, just so I can have a remote pull if I need it.
To get it all going, I needed to do just a few things for decent Xcode integration. I say decent because there's really no Xcode integration at this time for git - it's all on the command line. However, because I always have a terminal session open to the project directory, the really important issue is how the files are treated in git. Thankfully, git is wonderful at this.
I first went into the project directory Xcode made, and created the git repository:
$ cd ~/Developer/CryptoQuip $ git init
then I needed to set up my project-based .gitignore and .gitattributes based on this posting that is a great place to start if you don't already have some decent defaults for git. I created two files in the root project directory. First, .gitignore:
build/* *.pbxuser *.mode1v3 profile
and then .gitattributes:
*.pbxproj -crlf -diff -merge
When I started looking at the new layout of the project directory that Xcode uses, it's far cleaner than the older project layout of NeXTSTEP-era projects (yes, I still have a few of them). The lines in the .gitignore make a lot of sense, and it's very nice how they have moved the old bundles into files that can be put into generic source control very easily.
Then I needed to put it on my home gitosis server so I could have a backup and remote pull. First, I needed to check out the gitosis-admin project:
$ git clone git@git.themanfromspud.com:gitosis-admin.git
then in the newly created gitosis-admin directory, edit the gitosis.conf file to add the new repository to the group I've created for everything:
[group everything] members = drbob@sherman writeable = JiGV CryptoQuip
then I need to check it back in and push it back to the server:
$ git commit -a -m "Added CryptoQuip project to the main group" $ git push
and it was all ready for the project.
To add the project, I simply went into the project directory and add it's new origin and then push it to the server:
$ cd ~/Developer/CryptoQuip $ git remote add origin git@git.themanfromspud.com:CryptoQuip.git $ git push origin master:refs/heads/master
and it's all up on the server and ready to go!
At this point, when I want to sync my local git repository to the main server-side one, I'll just have to do a push:
$ git push
and git will remember where I pushed it last and sync it up with the server repository. Very nice.
One final style point: on the server, a new repository is created but from the web server, the description is lacking any color. What I did was to login to the server, go to the newly created repository directory, and then edit the file called description. I changed it to a decent little one-liner and that was it. Done.