Showing posts from July, 2010

Using Git Inside a Git Hook

Using Git Inside a Git Hook can cause problems. In my previous post: " Signal 13 Problems with Git Hooks " I describe how we are trying to automatically merge certain types of branches into a branch that is designed to hold them all. Anyway, that means we want to run some git commands inside of the git hook. We change dirs into another directory where we have a clone of the repo and start telling git to merge some stuff and we get a bunch of remote: fatal: Not a git repository: '.' But if we run the exact same commands as the git user everything works fine. Huh. Eventually we got our linux guru over and he noticed that the environment under which the git user runs is totally different when inside a hook. Gitolite does a bunch of things to the env, but the one that was screwing us up was the setting of the GIT_DIR. After we figured that out, the solution was as easy as: ENV.delete 'GIT_DIR' in our ruby script that is triggered by the 'post-recei

Signal 13 Problems with Git Hooks

Ran into a gotcha in Git today when trying to write a post push hook. We want our designer to have a fast turn around time with clients so we're writing some hooks to merge all of the 'theme' branches he works with to get merged into a special preview branch which is then deployed to the preview site. And all this should happen after he does a 'git push.' Seems like a 'post-receive' hook is just what we want. Except that every time we tried to create one we got these errors on a push: error: git-shell died of signal 13 fatal: The remote end hung up unexpectedly error: error in sideband demultiplexer If the 'post-receive' file even existed in git_dir/hooks/ on the git repo box, we got this error. We checked permissions, gitolite docs, git docs, google, etc and no help. We finally realized that Git was piping in some information to our 'post-receive' file and since we were not consuming it, that was causing the explosion. So, I prese

Ruby Midwest 2010 Saturday

So day 2 begins. I got to bed early-ish as I am old so I'm fresh as a daisy and ready for more Ruby. As per my established practice, Tweets are in italics. Keynote by Yehuda Katz (@wycats) is up next at #RubyMidwest I'm wondering why you can't give a technical keynote? Everyone says so. #RubyMidwest Why is that, exactly? It's a technical conference. And a single track one at that. So I say tech it up, baby. Things that seem really easy are actually huge blockers to new users @wycats #RubyMidwest .@wycats started Rails dev on windows - me too. #RubyMidwest "What the F** is that thing with raw_host on it?" Ex of a small thing that is a blocker to a noob @wycats #RubyMidwest Yeah, I had a few of those. I had no idea how to do public static final in Ruby. When I figured it out it lead to one of my early blog posts: Public Static Final for Ruby RT: @RubyMidwest Big thanks to @mbleigh and @intridea for hosting the OMGWTFBBQ dinner/lightening talks/hack

Ruby Midwest 2010 Friday

So people often ask me why I tweet so much at conferences (113 tweets today, for example). Well, usually I'm furiously typing notes into TextMate so I can blog about it later. Now, in the post twitter world, I type those thoughts into twitter and harvest them later for my wrap-up posts. That way people can follow a conf's progress live or wait for the recap. So Tweets will be in italics and everything else is bonus commentary. Generally the first day of the conference went amazingly well. Hard to believe this is their first year. Wifi was plentiful, food was decent, and the space was nice. Oh and the talks were good too. At @RubyMidwest waiting for the fun to begin So I think the official hash tag for @RubyMidwest is #rbmw or at least that's what the welcome tag said. Although #RubyMidwest is popular So there was a lot of confusion about the official Ruby Midwest Twitter hashtag. The badges said one thing, the welcome screen said another, and everyone else chose a th

The Road to Ruby Midwest

Crazy day: It was the day before Ruby Midwest so I gave my 'Speedy Tests' talk to my workmates at Backstop Solutions during lunch today and they had the nerve to find some things wrong with it -- so I'll be doing some re-tooling before Saturday. Then I was all set to leave 2 hours early for the airport when my manager wants to talk about me helping QA understand our process, new features, and maybe get some automated tests running. Hell to the yeah. So I'm all over this opportunity but our conversation makes me leave the office a bit late to catch my flight. No problem, I build in a lot of buffer. Then the Blue line (Chicago's subway) was down. Uh oh. Some surly dude said there was a free shuttle to somewhere else but I couldn't find it so I took a cab. Crazy traffic puts me at the airport with 30 min until my flight. Panic! But the security lines are longish so I panic while inching forward in a zig-zag line. Then I sprint to terminal C (which is t