Post deployment log to Basecamp »
Created at: 05.04.2008 17:53, source: poocs.net - Home, tagged: rails basecamp capistrano deployment git rails
I guess many of you have been reading the recent Signal vs. Noise blog post titled Using Basecamp to automatically keep track of product releases. I found it rather inspiring so I started to work on something similar for my own projects.
Out of that effort comes a super simple Capistrano plugin that grabs the first line from each commit (the subject in Git lingo) that happened between the last deploy and the current one and posts it as a new message to a pre-defined project (and category) on your Basecamp account using the Basecamp API.
Installation
$ cd <yourapp>/vendor/plugins
$ git clone git@github.com:scoop/basecamp_notify.git
It automatically hooks itself into your deployment process after deploy:symlink has run. Here’s a direct link to the GitHub repository.
If you don’t have git, you can download a tarball from GitHub, but read the caveat in the next section.
Configuration
The download ships with an example YAML configuration that needs to go into <yourapp>/config/basecamp.yml. It takes your Basecamp URL, username, and password as well as the numeric IDs for the project and category to post to, respectively.
Caveat: Since I wanted a fairly concise output in my posted messages (resembling what 37signals has in their example), I used a special command-line argument formatting thingamagick that only Git understands, so the plugin could be considered Git-only for now. Feel free to send in a patch that does the same for subversion.

Questions?
Email me at patrick@limited-overload.de if you have questions. Hope it’s useful for some of you.
UPDATE 04/11: basecamp_notify now has support for Subversion repositories. Thanks pyrat.
more »
starting the migration to GitHub »
Created at: 05.03.2008 09:48, source: Rails on the Run - Home, tagged: git plugins Projects
I started moving some of my projects to GitHub.
Projects moved to GitHub:
I'm planning on moving GoogleCharts, RandomWordGenerator and some not released stuff to GitHub so people can have fun forking my projects.
Git and GitHub are the new cool things. GitHub is planning on setting up a gem server while they are already offering tarball download and a post-receive hook. (they also plan on becoming myspace for geeks, but that's another story)
Do you have to switch to git and github? Honestly, ...no you don't.. Git can act as SVN, but let's be honest, if you switch to a new SCM it needs to do more. I've been using Git for a couple of months and even though I still don't have a full understanding of this SCM, I really enjoy using it.
So, get over it, learn on your own or purchase this excellent peepcode
Email me to get a GitHub invite (Tom and Chris gave me some invites for readers) or/and try Gitorious.
The fact that some major players (Topfunky, technoweenie, Chris & PJ, jnunemaker and major projects such as capistrano, vlad the deployer and Merb use and support Git is a sign that it's the next big thing.
Also, I believe that a lot of developers will also be motivated to move their plugins/gems to GitHub because they simply can't always maintain their own libs and/or just hope people will fork their project and contribute back.
more »
How to use github and submit a patch »
Created at: 03.03.2008 10:22, source: Rails on the Run - Home, tagged: contribute git github merb
If you don't know about git and github yet, it's time you clean up your RSS feeds and find some good source of information.
Github is used by the Merb core team and I'll show you how to use github to fork Merb, make your modifications and "submit your patch".
This is the exact reason why github is simply awesome, it makes forking projects just super simple and submitting changes even easier.
First thing, you need to have a github account, if you don't have one yet, email me, I have a couple of invitations left, otherwise, just wait until github gets public.
Now, let's go to Merb's repository and fork Merb-core by clicking on the fork button.

Actually, for this example, I'll fork merb-plugins because I want to improve the ActiveRecord rake tasks.
Because I forked merb-plugins, I now have my own forked repo: !
I'll start by checking out/cloning my forked repo locally.
git clone git@github.com:matta/merb-plugins.git |
!
Great I can now make my own changes.... but wait, what if the merb core team makes a change to the code? Well, I need to track their changes. Here is how:
git remote add coreteam git://github.com/wycats/merb-plugins.git |
FYI, it adds the following to edit .git/config:
1 2 3 4 |
[remote "coreteam"] url = git://github.com/wycats/merb-plugins.git fetch = +refs/heads/*:refs/remotes/coreteam/* |
then
git fetch coreteam |
and finally
git checkout -b coreteam coreteam/master |
You can now track the latest change and merge them with your branch. Note that you can also track other forks and merge some other changes. (just that feature is worth using git)
Alright, now you can do your stuff, and push your local change to your remote repo at github.
Once you are done, you can simply click on the "pull request button"

fill up the form and select the recipient. (wycats in this example if you want him to merge your changes into the official version of Merb).

p.s: The github guys are working on a gem to make our loves easier, give http://github.com/defunkt/github-gem/tree/master a try. I'll post about the gem when it will be a bit more stable.
more »
resolving git-svn conflicts »
Created at: 01.03.2008 00:40, source: Rails on the Run - Home, tagged: git git-svn repository scm subversion svn
I've been using git and git-svn for a little while and never had a problem... until today.
On one of my project, we have a SVN repo but since I prefer using Git, I'm using git-svn.
Git-svn has been great, it let me create my own local branches for each new set of features (that's when I don't forget to create a branch) and to commit all the changes back to svn.
The problem today happened after I did a simple git-svn rebase. I had some sort of error and my local repo looked like it got reverted to the head of the svn repo....
error: patch failed: trunk/app/models/view.rb:1
error: trunk/app/models/view.rb: patch does not apply
[blah blah]
sing index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
I hadn't committed to SVN for 24 hours and had a lot of work that was just checked in locally... You can imagine the panic. Rob started digging in the .git repo to finally find the hash representing the latest delta before the rebase. With the help of the #caboose guys, I did a simple
git reset --hard hash-name
Which restore my repo to the pre SVN commit state. Awesome... however I still had issues to commit my stuff. After a little while I as able to commit again, worked a bit more and tried to commit again.... same error :(
But this time I noticed I could simply do
git rebase --abort
to restore the original branch.an
But I still couldn't commit properly... until I discovered that I just needed to fix the conflicts manually using
git-mergetool
git-mergetool uses whichever merge tool available: kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff filemerge
I fixed my conflicts in no time, then did a
git rebase --continue
and finally
git-svn dcommit
Looking back, I wish I knew how to properly deal with conflicts when using git-svn, I wasted a bit of my precious time ;) hopefully this post will help you.
p.s: here is an interesting use of Sake to handle git-svn
more »
