Sunday, May 29, 2011

I have some great news. I have finally been getting around to updating all of my code and getting it into public source control, namely GitHub. The other day I moved over the youtube api files (as well as updated them). Check the original blog post for links to that repo if you are interested.

All this updating and source control got me thinking that I should make some Git Komodo Edit tools just like the subversion tools. This task wasn't too difficult as git and svn aren't that different from each other. I will outline them for you.

First is "Git Add All New". It's purpose is to add any new files you created to your repository. It is worth noting that adding != committing. When you add a file to git you are simply telling it to put that file into source control on the next commit. This is exactly the same way the subversion control works.

Next is "Git Checkout" which as you might expect is for checking out (git calls it cloning) a repository. One thing to note here, you need to have a komodo project already open otherwise the files will be checked out into your root directory instead of a projects root directory.

"Git Commit" is what makes all the magic happen it will commit all of your changed files and add any new files to the repository.

"Git Diff" will diff the currently viewed file with the version of that file stored in the repository. The output is the standard console diff format so if you aren't real familiar with that you might have some trouble spotting changes.

"Git Init" will create a new empty repository in the root of the currently active project.

"Git Push Remote" lets you push your local repository changes out to a remote repo like GitHub.

Finally there is "Git Update" which updates your project files with the most current version stored in the repository.

While I was working on the "Git Diff" tool I realized that the same tool could be created for my subversion tools so I went ahead and took the liberty of creating that.

"Subversion Diff" diffs the currently viewed file with the version that is stored in the repository. Again it uses the standard console diff syntax.

There you have it all those tools seem to work correctly for me if you have any difficulties let me know in the comments.

I have my git binary stored in the same location but I made a soft link to it in /usr/local/bin as well. So if updating the PATH value in Komodo IDE doesn't work try linking the git binaries in /usr/local/bin

Your Tools actually work in 'IDE' the same as 'Edit', though it's 'Edit' I'm now using and will continue to use (because it's free)

Your suspicion was right that the PATH env variable wasn't being set for Komodo to find 'git'. This is extremely weird because I've set 'PATH' every place imaginable from .profile to ~/.MacOSX/environment.plist. Komodo seems never to pick up the modified path.

As you say luckily it has its own feature to provide a user over-ride env variables it's relying on. So I add '/usr/local/git/bin' to 'PATH' inside Komodo Edit and things start to improve.

Still can't clone (destination path 'maingit' already exists and is not an empty directory.) or pull (not a command), but working on that.