Posts

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-receive...

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 present to...

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...