CFGit (coldfusion and Git. get it?)

I wish I could be more original with project names, anyway ... this is just an experiment I was playing around with tonight and I wanted to share before I left it in folder oblivion. At the moment it is a rather bare bones CFC for talking to Git. You can run currently on run:
* Status
* Log
* Show
* But you can easily add more

The benefit (which is where the idea started) is that you don't have to be in the git project to run this!

I've only tested on a Mac w/CF9 so would be glad for any feed back on other platforms or suggestions!

Below is the CFC code alone but if you want to check it all out (an index.cfm and Readme.txt file, thats it!) check out: github.com/andyj/CFGit

Posted: 19-Oct-2010

View: 2323

Permalink: here

Comments

Pretty good idea. I've often thought it'd be useful to have an application check if it's under Git and display some information if it is.

Have you thought about using the Java implementation of Git? Might help make it more portable.

#1 David Boyer
19/Oct/10 10:34 AM

I decided not to use jGit to make it more portable in terms of dropping in the code and running. jGit would help across mulitple OS's but with some tweaking in regards to slashes and other intricacies I cannot see it being hard to do in pure ColdFusion?

I have found out though that @rickosborneorg already has done something similar with a Git watcher gateway for CF 9+ that requires JGit (org.eclipse.jgit-*.jar) to be installed on the CF Server http://bit.ly/dAw4dq

#2 Andy Jarrett
19/Oct/10 11:13 AM


#3 i hate bitly
19/Oct/10 11:56 AM

You could use the JGit CLI pretty easy with your existing code. Having to drop a jar into the classpath (or you could use JavaLoader if you don't want to have to do even that) is more portable than requiring Git to be installed on the host (which can be a PITA), IMO. Java takes care of the slashes, so you shouldn't, theoretically, need different code for windows...

#4 denstar
19/Oct/10 8:56 PM

ok ... i've been convinced by the both of you :D jGit is next on my list of things to look at

#5 Andy Jarrett
19/Oct/10 10:08 PM